예제 #1
0
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            attributeHorizontal = (AttributeHorizontal)attribute;
            string[] BasePath = attributeHorizontal.BasePath;
            string[] Paths    = attributeHorizontal.Paths;
            DrawRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);
            DrawRect = EditorExpand.InputField(position, DrawRect, property, property.displayName, (Paths.Length + 1));

            if (BasePath.Length > 0)
            {
                for (int i = 0; i < BasePath.Length; i++)
                {
                    if (i == 0)
                    {
                        BaseProperty = property.serializedObject.FindProperty(BasePath[i]);
                    }
                    else
                    {
                        BaseProperty = BaseProperty.FindPropertyRelative(BasePath[i]);
                    }
                }

                for (int i = 0; i < Paths.Length; i++)
                {
                    var Lproperty = BaseProperty.FindPropertyRelative(Paths[i]);//먼저 BasePath에 접근
                    DrawRect = EditorExpand.InputField(position, DrawRect, Lproperty, Lproperty.displayName, (Paths.Length + 1));
                }
            }
        }
예제 #2
0
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            attributeLabel = (AttributeLabel)attribute;
            HightLight     = attributeLabel.HightLight;
            Text           = attributeLabel.Text;

            Vector2 TextArea = GUI.skin.label.CalcSize(new GUIContent(Text));
            Rect    DrawRect = new Rect();

            if (attributeLabel.Expand)
            {
                DrawRect = new Rect(position.x, position.y, position.width, TextArea.y);
            }
            else
            {
                DrawRect = new Rect(position.x, position.y, TextArea.x + 15, TextArea.y);
            }

            if (HightLight)
            {
                EditorGUI.HelpBox(DrawRect, Text, MessageType.None);
                DrawRect = EditorExpand.NextLine(position, DrawRect);
                TypeEnum Ltype = VariableCollection.ConvertTypeEnum(EditorExpand.PropertyTypeToType(property.type).Name);
                EditorExpand.InputField(position, DrawRect, property, property.displayName, 1);
            }
            else
            {
                EditorGUI.LabelField(DrawRect, Text);
                DrawRect = EditorExpand.NextLine(position, DrawRect);
                TypeEnum Ltype = VariableCollection.ConvertTypeEnum(EditorExpand.PropertyTypeToType(property.type).Name);
                EditorExpand.InputField(position, DrawRect, property, property.displayName, 1);
            }
        }
예제 #3
0
 public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
 {
     attributeField = (AttributeField)attribute;
     position       = EditorExpand.InputField(position, position, property, property.displayName, 1, attributeField.Space);
 }