implicitly - 묵시적 explicit - 명시적 C / C++ 에서는 어떤 변수가 NULL인지 검사하기위해 조건문을 쓸 수 있다. C / C++ 에서는 조건문 안에 있는 수식이 0이면 false, 0이 아니면 true로 판단 하기 때문. A* a = new A(); if (a) { somthing... } C# 에서는 위와 같이 쓸수가 없다. 이유는 조건문에 들아가는 타입이 bool 형 이여야 하기 때문이다. 하지만 유니티에서는 Object를 상속받은 클래스 인스턴스들은 가능한데 그 이유가 Object 클래스가 bool 타입에 대해 묵시적 형 변환 연산자를 구현했기 때문. UnityEngine.Object.cs public static implicit operator bool(Object exi..
\u 형태의 이모지 메세지를 보낼때. 1. string System.Text.RegularExpressions.Regex.Unescape(string); private string EncodeNonAsciiCharacters(string value) {StringBuilder sb = new StringBuilder();for (int i = 0; i 127) {string encodeValue = "\\u" + ((int) value[i]).ToString("x4");sb.Append(encodeValue);} else {sb.Append(value[i]);}} return sb.ToString();} private string Deco..
Value = ( Content positoin ) / ( whole content height - content view height ) 값 = 컨테츠 위치 / ( 컨텐츠 전체 높이 - 보여지는 영역 높이 ) Ex) float scrollValue = ( 보여주고 싶은 위치 ) / (scrollRect.content.rect.height - scrollRect.GetComponent().rect.height); scrollRect.verticalNormalizedPosition = scrollValue;
MonoBehaviour Singleton. public class MonoBehaviourSingleton : MonoBehaviour where T: MonoBehaviour { protected bool isDonDestroy = false; void Awake() { if (isDonDestroy) { DontDestroyOnLoad(this.gameObject); } } private static T instance; public static T Instance { get { if (instance == null) { T[] objs = FindObjectsOfType(); if (objs.Length > 0) { instance = objs[0]; } if (instance == null) {..
MonoBehaviour DescriptionOnBecameInvisible is called when the renderer is no longer visible by any camera.This message is sent to all scripts attached to the renderer. OnBecameVisible and OnBecameInvisible is useful to avoid computations that are only necessary when the object is visible. 화면 밖으로 나가 어떠한 카메라에도 보이지 않을경우 불리는 함수. OnBecameInvisible / OnBecameVisible 은 Render 관련 함수여서 Mesh Render Compon..
