Unity1 Unity C#, ReadOnly Attribute #if UNITY_EDITOR 에 대해서는 플랫폼 의존 컴파일 참고하자. using UnityEditor; using UnityEngine; #if UNITY_EDITOR /// /// 인스펙터로 내용을 볼 수 있지만 수정할 수 없습니다. /// public class ReadonlyAttribute : PropertyAttribute { } [CustomPropertyDrawer(typeof(ReadonlyAttribute))] public class ShowOnlyDrawer : PropertyDrawer { public override void OnGUI(Rect position, SerializedProperty property, GUIContent content) { string str; swi.. 2021. 3. 19. 이전 1 다음