예제 #1
0
        private Rect DrawTag(Rect position)
        {
            //Draw tagType
            Rect   newPosition = EditorTool.DrawPropertyField(position, tagType);
            float  height      = newPosition.height;
            string tagTypeName = tagType.enumNames[tagType.enumValueIndex];

            //Draw necissary fields based on tag type
            switch (tagTypeName)
            {
            case "SpeakerName":
                //Draw text
                newPosition = EditorTool.DrawTextField(newPosition, tagName, "Speaker Name");
                height     += newPosition.height;
                break;

            case "ChangeBranch":
                newPosition = EditorTool.DrawIntField(newPosition, id, "ID");
                height     += newPosition.height;
                break;

            case "ChangeStage":
                //draw id
                newPosition = EditorTool.DrawIntField(newPosition, id, "ID");
                height     += newPosition.height;
                break;
            }
            newPosition = EditorTool.DrawReorderableList(newPosition, instructionsList, "Instructions");
            height     += newPosition.height;
            newPosition = new Rect(newPosition.x, newPosition.y, newPosition.width, height);
            //EditorGUI.DrawRect(newPosition, Color.blue);
            return(newPosition);
        }
        protected Rect DrawTag(Rect position)
        {
            //Draw tagType
            Rect newPosition = EditorTool.DrawPropertyField(position, tagType);

            //add indent
            newPosition = EditorTool.GetIndentedPosition(newPosition);
            //Draw necissary fields based on tag type
            switch (tagType.intValue)
            {
            case 2:
                //Draw id
                newPosition = EditorTool.DrawIntField(newPosition, id, "ID");
                break;

            case 3:
                //Draw id
                newPosition = EditorTool.DrawIntField(newPosition, id, "ID");
                break;
            }
            return(newPosition);
        }