Пример #1
0
        public static Rect DrawTopLabel(Rect position, string label, bool usePadding = true)
        {
            //set initial rect
            Rect newPosition = EditorTool.GetStartingPosition(position, usePadding);

            //draw label
            EditorGUI.LabelField(newPosition, label, EditorStyles.boldLabel);
            //add indent
            newPosition = GetIndentedPosition(newPosition);
            return(newPosition);
        }
Пример #2
0
        protected Rect DrawTopLabel(Rect position)
        {
            //set initial rect
            Rect newPosition = EditorTool.GetStartingPosition(position);

            //draw label
            EditorGUI.LabelField(newPosition, name.stringValue, EditorStyles.boldLabel);
            //add indent
            newPosition = EditorTool.GetIndentedPosition(newPosition);
            return(newPosition);
        }
Пример #3
0
        public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
        {
            SetProperties(property);
            float totalHeight = 0F;

            //UniqueID
            totalHeight += EditorTool.GetAddedHeight(EditorTool.LineHeight);
            //text
            totalHeight += EditorTool.GetAddedHeight(EditorTool.GetHeight(name));
            return(totalHeight);
        }
Пример #4
0
        protected override void DrawChildProperties(Rect position, SerializedProperty property)
        {
            Rect newPosition = new Rect(position.x, position.y, position.width, 0F);

            //draw unique id
            Debug.Log(uniqueID.stringValue);
            newPosition = DrawUniqueID(newPosition);
            //draw name
            Debug.Log(name.stringValue);
            newPosition = EditorTool.DrawTextArea(newPosition, name, "Name");
        }
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            SetProperties(property);
            Rect newPosition = EditorTool.DrawTopLabel(position, "Instruction Data");

            newPosition = EditorTool.DrawPropertyField(newPosition, extension, "Extension");
            string enumValue = extension.enumNames[extension.enumValueIndex];

            switch (enumValue)
            {
            case "Story":
                newPosition = EditorTool.DrawArray(newPosition, identifier, "Identifier");
                break;
            }
        }
Пример #6
0
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            mythID   = property.FindPropertyRelative("mythID");
            storyID  = property.FindPropertyRelative("storyID");
            threadID = property.FindPropertyRelative("threadID");
            stageID  = property.FindPropertyRelative("stageID");
            Rect newPosition = new Rect(position.x, position.y, position.width, 0F);

            //draw story index label
            newPosition = EditorTool.DrawLabel(newPosition, "Story Index");
            //draw myth id
            newPosition = EditorTool.DrawIntField(newPosition, mythID, "Myth ID");
            //draw story id
            newPosition = EditorTool.DrawIntField(newPosition, storyID, "Story ID");
            //draw thread id
            newPosition = EditorTool.DrawIntField(newPosition, threadID, "Thread ID");
            //draw stage id
            newPosition = EditorTool.DrawIntField(newPosition, stageID, "Stage ID");
        }
        public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
        {
            SetProperties(property);
            float totalHeight = EditorTool.InitialVerticalPadding;

            //label
            totalHeight += EditorTool.AddedLineHeight;
            //extension
            totalHeight += EditorTool.AddedLineHeight;
            string enumValue = extension.enumNames[extension.enumValueIndex];

            switch (enumValue)
            {
            case "Story":
                float identifierHeight = EditorTool.AddedLineHeight;
                for (int i = 0; i < identifier.arraySize; i++)
                {
                    identifierHeight += EditorTool.GetAddedHeight(EditorTool.GetHeight(identifier.GetArrayElementAtIndex(i)));
                }
                totalHeight += identifierHeight;
                break;
            }
            return(totalHeight);
        }
Пример #8
0
 public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
 {
     return(EditorTool.GetAddedHeight(EditorTool.LineHeight) * 5F);
 }