[링크] 유니티5 업그레이드 가이드
'Unity3D > Tips' 카테고리의 다른 글
| iOS Native 관련.. (0) | 2015.05.12 |
|---|---|
| Scene뷰에서 Handles.Label() (0) | 2015.05.08 |
| 유니티4.5 Hierarchy 뷰에서 오브젝트 소팅 변경 (2) | 2015.03.04 |
| BBCode tags reference (0) | 2015.02.08 |
| 안드로이드 유니티 리모트 4 연동 문제 해결하기 (0) | 2015.02.04 |
| iOS Native 관련.. (0) | 2015.05.12 |
|---|---|
| Scene뷰에서 Handles.Label() (0) | 2015.05.08 |
| 유니티4.5 Hierarchy 뷰에서 오브젝트 소팅 변경 (2) | 2015.03.04 |
| BBCode tags reference (0) | 2015.02.08 |
| 안드로이드 유니티 리모트 4 연동 문제 해결하기 (0) | 2015.02.04 |
Link : http://forum.unity3d.com/threads/unity-4-5-new-hierarchy-window-sorting.248298/#post-1642742
[File]
기존의 이름이 아닌 트랜스폼 기준으로 변경되었는데요.
| Scene뷰에서 Handles.Label() (0) | 2015.05.08 |
|---|---|
| [링크] 유니티5 업그레이드 가이드 (0) | 2015.03.30 |
| BBCode tags reference (0) | 2015.02.08 |
| 안드로이드 유니티 리모트 4 연동 문제 해결하기 (0) | 2015.02.04 |
| Unity Platform Defines (0) | 2015.01.28 |
In this section, a reference table for all of the more popular bbcode tags, is provided. Some are considered to be standard and should be supported in just about any bbcode implementation. Other are less likely to be supported, but nonetheless popular (hence the reason they've been included here).
| Name | Syntax | Purpose | Example |
|---|---|---|---|
| Bold | [b]{text}[/b] | Makes {text} bold | Bold example |
| Italic | [i]{text}[/i] | Makes {text} italic | Italic example |
| Underline | [u]{text}[/u] | Underlines {text} | Underline example |
| Line-through | [s]{text}[/s] | Create a line-through/strike through on {text} | Line-through example |
| Font-size | [size={number}]{text}[/size] | Changes the font-size of {text} | Font-size example |
| Font colour | [color={colour}]{text}[/color] | Changes the colour of {text} | Font colour example |
| Center text | [center]{text}[/center] | Centers {text} on screen | Center text example |
| Quote | [quote]{text}[/quote] | Creates a quotation box containing {text} | Quote example |
| Quote (named) | [quote={name}]{text}[/quote] | Creates a quotation box quoting {name} as saying {text} | Quote (named) example |
| Link | [url]{url}[/url] | Makes a link to {url} | Link example |
| Link (named) | [url={url}]{text}[/url] | Makes a named link to {url} | Link (named) example |
| Image | [img]{url}[/img] | Shows the image indicated by {url} | Image example |
| Image (resized) | Full version: [img width={width} height={height} ...]{url}[/img] Another variant (shorthand): [img={width}x{height}]{url}[/img] | Shows {url} image resized to {width} and {height} | Image (resized) example |
| List | Unordered list: [ul]{items}[/ul] Ordered list: [ol]{items}[/ol] Another variant: [list]{items}[/list] | Displays a list of {items} | List example |
| List item | [li]{text}[/li] Shorthand: [*]{text}\newline | Species an {item} within a list | List item example |
| Code | [code]{text}[/code] | Renders the {text} while maintaing all white spacing | Code example |
| Tables | [table]{rows}[/table] | Show a table with {rows} in it | Tables example |
| Table rows | [tr]{cells}[/tr] | Renders a table row containing {cells} | Table rows example |
| Table content cells | Heading cell: [th]{content}[/th] Content cell: [td]{content}[/td] | Shows {content} in a table (heading) cell | Table content cells example |
| Youtube videos | [youtube]{id}[/youtube] | Shows the youtube video indicated by {id} | Youtube videos example |
| Google videos | [gvideo]{id}[/gvideo] | Shows the google video indicated by {id} | Google videos example |
If you think that some tags are missing here, please do not hesitate to contact us!
Go to the examples section to find many examples of how you can use these tags.
| [링크] 유니티5 업그레이드 가이드 (0) | 2015.03.30 |
|---|---|
| 유니티4.5 Hierarchy 뷰에서 오브젝트 소팅 변경 (2) | 2015.03.04 |
| 안드로이드 유니티 리모트 4 연동 문제 해결하기 (0) | 2015.02.04 |
| Unity Platform Defines (0) | 2015.01.28 |
| [펌] 데이터 패스(Data Path) 정리 (0) | 2015.01.12 |
| 유니티4.5 Hierarchy 뷰에서 오브젝트 소팅 변경 (2) | 2015.03.04 |
|---|---|
| BBCode tags reference (0) | 2015.02.08 |
| Unity Platform Defines (0) | 2015.01.28 |
| [펌] 데이터 패스(Data Path) 정리 (0) | 2015.01.12 |
| [펌] 유니티 최적화 테크닉 총정리 (0) | 2014.12.09 |
[출처] http://docs.unity3d.com/Manual/PlatformDependentCompilation.html
Unity’s Platform Dependent Compilation feature consists of some preprocessor directives that let you partition your scripts to compile and execute a section of code exclusively for one of the supported platforms.
You can run this code within the Unity Editor, so you can compile the code specifically for your target platform and test it in the Editor.
The platform #define directives that Unity supports for your scripts are as follows:
| Define | Function |
|---|---|
| UNITY_EDITOR | #define directive to call Unity Editor scripts from your game code. |
| UNITY_EDITOR_WIN | #define directive for Editor code on Windows. |
| UNITY_EDITOR_OSX | #define directive for Editor code on Mac OS X. |
| UNITY_EDITOR_LINUX | #define directive for Editor code on Linux. |
| UNITY_STANDALONE_OSX | #define directive to compile or execute code specifically for Mac OS X (including Universal, PPC and Intel architectures). |
| UNITY_STANDALONE_WIN | #define directive for compiling/executing code specifically for Windows standalone applications. |
| UNITY_STANDALONE_LINUX | #define directive for compiling/executing code specifically for Linux standalone applications. |
| UNITY_STANDALONE | #define directive for compiling/executing code for any standalone platform (Mac OS X, Windows or Linux). |
| UNITY_WII | #define directive for compiling/executing code for the Wii console. |
| UNITY_IOS | #define directive for compiling/executing code for the iOS platform. |
| UNITY_IPHONE | Deprecated. Use UNITY_IOS instead. |
| UNITY_ANDROID | #define directive for the Android platform. |
| UNITY_PS4 | #define directive for running PlayStation 4 code. |
| UNITY_XBOXONE | #define directive for executing Xbox One code. |
| UNITY_LUMIN | #define directive for the Magic Leap OS platform. You can also use PLATFORM_LUMIN. |
| UNITY_TIZEN | #define directive for the Tizen platform. |
| UNITY_TVOS | #define directive for the Apple TV platform. |
| UNITY_WSA | #define directive for Universal Windows Platform. Additionally, NETFX_CORE is defined when compiling C# files against .NET Core and using .NET scripting backend. |
| UNITY_WSA_10_0 | #define directive for Universal Windows Platform. Additionally WINDOWS_UWP is defined when compiling C# files against .NET Core. |
| UNITY_WINRT | Same as UNITY_WSA. |
| UNITY_WINRT_10_0 | Equivalent to UNITY_WSA_10_0 |
| UNITY_WEBGL | #define directive for WebGL. |
| UNITY_FACEBOOK | #define directive for the Facebook platform (WebGL or Windows standalone). |
| UNITY_ANALYTICS | #define directive for calling Unity Analytics methods from your game code. Version 5.2 and above. |
| UNITY_ASSERTIONS | #define directive for assertions control process. |
| UNITY_64 | #define directive for 64-bit platforms. |
You can also compile code selectively. The options available depend on the version of the Editor that you are working on. Given a version number X.Y.Z (for example, 2.6.0), Unity exposes three global #define directives in the following formats: UNITY_X, UNITY_X_Y and UNITY_X_Y_Z.
Here is an example of #define directives exposed in Unity 5.0.1:
| Define | Function |
|---|---|
| UNITY_5 | #define directive for the release version of Unity 5, exposed in every 5.X.Y release. |
| UNITY_5_0 | #define directive for the major version of Unity 5.0, exposed in every 5.0.Z release. |
| UNITY_5_0_1 | #define directive for the minor version of Unity 5.0.1. |
Starting from Unity 5.3.4, you can compile code selectively based on the earliest version of Unity required to compile or execute a given portion of code. Given the same version format as above (X.Y.Z), Unity exposes one global #define in the format UNITY_X_Y_OR_NEWER, that can be used for this purpose.
The supported #define directives are:
| Define | Function |
|---|---|
| CSHARP_7_3_OR_NEWER | Defined when building scripts with support for C# 7.3 or newer. |
| ENABLE_MONO | Scripting backend #define for Mono. |
| ENABLE_IL2CPP | Scripting backend #define for IL2CPP. |
| NET_2_0 | Defined when building scripts against .NET 2.0 API compatibility level on Mono and IL2CPP. |
| NET_2_0_SUBSET | Defined when building scripts against .NET 2.0 Subset API compatibility level on Mono and IL2CPP. |
| NET_LEGACY | Defined when building scripts against .NET 2.0 or .NET 2.0 Subset API compatibility level on Mono and IL2CPP. |
| NET_4_6 | Defined when building scripts against .NET 4.x API compatibility level on Mono and IL2CPP. |
| NET_STANDARD_2_0 | Defined when building scripts against .NET Standard 2.0 API compatibility level on Mono and IL2CPP. |
| ENABLE_WINMD_SUPPORT | Defined when Windows Runtime support is enabled on IL2CPP. See Windows Runtime Support for more details. |
| ENABLE_INPUT_SYSTEM | Defined when the Input System package is enabled in Player Settings. |
| ENABLE_LEGACY_INPUT_MANAGER | Defined when the legacy Input Manager is enabled in Player Settings. |
You use the DEVELOPMENT_BUILD #define to identify whether your script is running in a player which was built with the “Development Build” option enabled.
You can also compile code selectively depending on the scripting back-end.
Below is an example of how to use the precompiled code. It prints a message that depends on the platform you have selected for your target build.
First of all, select the platform you want to test your code against by going to File > Build Settings. This displays the Build Settings window; select your target platform from here.

Select the platform you want to test your precompiled code against and click Switch Platform to tell Unity which platform you are targeting.
Create a script and copy/paste the following code:
// C#
using UnityEngine;
using System.Collections;
public class PlatformDefines : MonoBehaviour {
void Start () {
#if UNITY_EDITOR
Debug.Log("Unity Editor");
#endif
#if UNITY_IOS
Debug.Log("Iphone");
#endif
#if UNITY_STANDALONE_OSX
Debug.Log("Stand Alone OSX");
#endif
#if UNITY_STANDALONE_WIN
Debug.Log("Stand Alone Windows");
#endif
}
}
To test the code, click Play Mode. Confirm that the code works by checking for the relevant message in the Unity console, depending on which platform you selected - for example, if you choose iOS, the message “Iphone” is set to appear in the console.
In C# you can use a CONDITIONAL attribute which is a more clean, less error-prone way of stripping out functions. See ConditionalAttribute Class for more information. Note that common Unity callbacks (ex. Start(), Update(), LateUpdate(), FixedUpdate(), Awake()) are not affected by this attribute because they are called directly from the engine and, for performance reasons, it does not take them into account.
In addition to the basic #if compiler directive, you can also use a multiway test in C#:
#if UNITY_EDITOR
Debug.Log("Unity Editor");
#elif UNITY_IOS
Debug.Log("Unity iPhone");
#else
Debug.Log("Any other platform");
#endif
It is also possible to add to the built-in selection of #define directives by supplying your own. Open the Other Settings panel of the Player settings and navigate to the Scripting Define Symbols text box.

Enter the names of the symbols you want to define for that particular platform, separated by semicolons. These symbols can then be used as the conditions for #if directives, just like the built-in ones.
You can define your own preprocessor directives to control which code gets included when compiling. To do this you must add a text file with the extra directives to the Assets folder. The name of the file depends on the language you are using. The extension is .rsp:
| C# (player and editor scripts) | <Project Path>/Assets/mcs.rsp |
As an example, if you include the single line -define:UNITY_DEBUG in your mcs.rsp file, the #define directive UNITY_DEBUG exists as a global #define for C# scripts, except for Editor scripts.
Every time you make changes to .rsp files, you need to recompile in order for them to be effective. You can do this by updating or reimporting a single script (.js or .cs) file.
Note:__If you want to modify only global #define directives, use Scripting Define Symbols__ in Player settings, because this covers all the compilers. If you choose the .rsp files instead, you need to provide one file for every compiler Unity uses.
The use of .rsp files is described in the ‘Help’ section of the mcs application, which is included in the Editor installation folder. You can get more information by running mcs -help.
Note that the .rsp file needs to match the compiler being invoked. For example:
mcs.rsp, andcsc.rsp.| BBCode tags reference (0) | 2015.02.08 |
|---|---|
| 안드로이드 유니티 리모트 4 연동 문제 해결하기 (0) | 2015.02.04 |
| [펌] 데이터 패스(Data Path) 정리 (0) | 2015.01.12 |
| [펌] 유니티 최적화 테크닉 총정리 (0) | 2014.12.09 |
| 텍스처, 리소스 메모리 최적화 (0) | 2014.12.02 |
파일 읽기 쓰기 가능
파일이 아닌 WWW로 읽기 가능
파일 읽기 쓰기 가능
파일이 아닌 WWW로 읽기 가능
파일 읽기 쓰기 가능
파일 읽기 가능, 쓰기 불가능
Application.temporaryCachePath 도 있습니다
윈도우 : %LocalAppData%/Local/Temp/Temp/%Company%/%Product%
Android Internal : /data/data/%BundleIdentifier%/cache
Android External : /mnt/sdcard/Android/data/%BundleIdentifier%/cache
iOS : /var/mobile/Applications/프로그램ID/Library/Caches
출처 : http://unitystudy.net/bbs/board.php?bo_table=dustin&wr_id=357
| 안드로이드 유니티 리모트 4 연동 문제 해결하기 (0) | 2015.02.04 |
|---|---|
| Unity Platform Defines (0) | 2015.01.28 |
| [펌] 유니티 최적화 테크닉 총정리 (0) | 2014.12.09 |
| 텍스처, 리소스 메모리 최적화 (0) | 2014.12.02 |
| 유니티 게임 최적화 성능을 위한 정리 (그래픽과 성능) (0) | 2014.10.17 |
| Unity Platform Defines (0) | 2015.01.28 |
|---|---|
| [펌] 데이터 패스(Data Path) 정리 (0) | 2015.01.12 |
| 텍스처, 리소스 메모리 최적화 (0) | 2014.12.02 |
| 유니티 게임 최적화 성능을 위한 정리 (그래픽과 성능) (0) | 2014.10.17 |
| 유저 기기 고유 ID(UUID) [SystemInfo.deviceUniqueIdentifier] (2) | 2014.10.07 |
* Memory 해제 관련...
*. Prefab 을 public GameObject variable 로 연결하면 1개가 살아있다...
- Resource 로 옮기고 Resource.Load 후 Instantiate 해준다음 Resource.UnloadUnusedAsset으로 로드했던 prefab을 해제시키자.
* Texture
- WWW 혹은 다른곳에서 load 한 texture 들은 사용하지 않을때 DestroyImmediate 로 꼭 해제시켜줘야 한다. DestroyImmediate 해주면 바로 memory 에서 해제된다.
*. GameObject Destroy 는 memory 를 바로 해제시키지 않는다.
- Resource.UnloadUnusedAssets 를 해야 memory 에서 해제된다.
- GameObject 를 DestroyImmediate 해도 포함되있는 Texture, material, 등은 memory에서 해제되지 않는다.
*. Load 한 Texture 들을 Member 로 가지고 있으면 GameObject Destroy 시 memory 해제 안된다.
- Texture 는 개별 DestroyImmediate 하여 바로바로 해제하자.
| [펌] 데이터 패스(Data Path) 정리 (0) | 2015.01.12 |
|---|---|
| [펌] 유니티 최적화 테크닉 총정리 (0) | 2014.12.09 |
| 유니티 게임 최적화 성능을 위한 정리 (그래픽과 성능) (0) | 2014.10.17 |
| 유저 기기 고유 ID(UUID) [SystemInfo.deviceUniqueIdentifier] (2) | 2014.10.07 |
| 안드로이드 네이티브 크래쉬 덤프 (ARM cpu) (0) | 2014.09.18 |
| [펌] 유니티 최적화 테크닉 총정리 (0) | 2014.12.09 |
|---|---|
| 텍스처, 리소스 메모리 최적화 (0) | 2014.12.02 |
| 유저 기기 고유 ID(UUID) [SystemInfo.deviceUniqueIdentifier] (2) | 2014.10.07 |
| 안드로이드 네이티브 크래쉬 덤프 (ARM cpu) (0) | 2014.09.18 |
| 모바일 게임 최적화의 정석 (0) | 2014.09.18 |
출처 : http://www.lionheart.pe.kr/board_uFoa63/913
현재 UDID라 불리는 Unique Device ID는 기기마다 가지고 있는 고유의 아이디입니다.
주로 폰에서 아이디를 만들떄 자동으로 만들어 줄려고 사용하는 거지만 안드로이드는 아무 문제가 없습니다
문제는 애플인데 저걸 사용하면 리젝사유가 된다고 하네요
iPhoneSettings.uniqueIdentifier 이 함수를 사용해 UDID라는 것을 생성을 할수가 있는데 이제는 쓰면 안되겠죠
(특히 일본쪽은 UDID나 Mac어드레스등 유저 해킹에 대한 정보를 가져다 쓰는 어플은 무조건 안된다고 합니다)
그래서 나온게 UUID라 불리는 Universally Unique ID 입니다
유니티 최신버젼을 쓰시면 SystemInfo.deviceUniqueIdentifier 값이 자동으로 생성된다고 합니다
앱을 깔고나서 지우면 값이 바뀌기는 하지만 여전히 고유값이라고 하네요
But,
UUID 분석을 통해 앱을 다시 지웠다가 설치 해도 바뀌지 않는 방법이 있습니다.
IOS 기기 국가정보 및 기기 UIDI 대체 UUID 키체인에 저장하여 사용하기(앱 다시 깔아도 그대로 기기값유지)
// 기기 국가정보가져오기
NSLocale *locale =[NSLocale currentLocale];
NSString *countryCode = [locale objectForKey:NSLocaleCountryCode];
//유니티 메세지 보내기
UnitySendMessage("GetDeviceID", "SetContry", [countryCode UTF8String]);
// 기기 아이디 생성해서 키체인에 저장
NSString *result_uuid = [[LUKeychainAccess standardKeychainAccess] stringForKey:@"uuid"];
if(result_uuid == nil)
{
NSString *uuid;
NSComparisonResult order = [[UIDevice currentDevice].systemVersion compare: @"6.0" options: NSNumericSearch];
if (order == NSOrderedSame || order == NSOrderedDescending) {
uuid = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
}
else
{
uuid = [[NSUUID UUID] UUIDString];
}
[[LUKeychainAccess standardKeychainAccess] setString:uuid forKey:@"uuid"];
result_uuid = [[LUKeychainAccess standardKeychainAccess] stringForKey:@"uuid"];
}
//기기아이디 유니티로 전송
UnitySendMessage("GetDeviceID", "SetDeviceID", [result_uuid UTF8String]);
* 기기 아이디 생성해서 키체인에 저장해서 쓰는 것은 첨부파일이 필요하다.
| 텍스처, 리소스 메모리 최적화 (0) | 2014.12.02 |
|---|---|
| 유니티 게임 최적화 성능을 위한 정리 (그래픽과 성능) (0) | 2014.10.17 |
| 안드로이드 네이티브 크래쉬 덤프 (ARM cpu) (0) | 2014.09.18 |
| 모바일 게임 최적화의 정석 (0) | 2014.09.18 |
| Doxygen For Unity (0) | 2014.09.11 |