Exemplo n.º 1
0
        /// <summary>
        /// Draw the canvas window inside the hero kit editor (hero property).
        /// </summary>
        /// <param name="id">ID assigned to the GUI Window</param>
        private void DrawCanvasWindowHeroProperty(int id)
        {
            scrollPosCanvas = EditorGUILayout.BeginScrollView(scrollPosCanvas, GUILayout.Width(windowCanvas.width), GUILayout.Height((int)(Instance.position.height - titleHeight)));

            SimpleLayout.BeginVertical(Box.StyleCanvas, (int)(Instance.position.height - titleHeight));

            switch (HeroPropertyMenuBlock.variableID)
            {
            case -1:
                SettingsBlock.Block();
                break;

            case 0:
                IntListBlock.Block(heroKitProperty);
                break;

            case 1:
                BoolListBlock.Block(heroKitProperty);
                break;

            case 2:
                StringListBlock.Block(heroKitProperty);
                break;

            case 3:
                GameObjectListBlock.Block(heroKitProperty);
                break;

            case 4:
                HeroObjectListBlock.Block(heroKitProperty);
                break;

            case 5:
                FloatListBlock.Block(heroKitProperty);
                break;

            case 6:
                UnityObjectListBlock.Block(heroKitProperty);
                break;
            }

            SimpleLayout.EndVertical();
            EditorGUILayout.EndScrollView();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Draw the canvas window inside the hero kit editor (hero object).
        /// </summary>
        /// <param name="id">ID assigned to the GUI Window</param>
        private void DrawCanvasWindowHeroObject(int id)
        {
            scrollPosCanvas = EditorGUILayout.BeginScrollView(scrollPosCanvas, GUILayout.Width(windowCanvas.width), GUILayout.Height((int)(Instance.position.height - titleHeight)));

            SimpleLayout.BeginVertical(Box.StyleCanvas, (int)(Instance.position.height - titleHeight));

            // draw state
            if (HeroObjectMenuBlock.typeID == 1)
            {
                if (HeroObjectMenuBlock.stateID == -1)
                {
                    // show state tutorial page
                }
                else
                {
                    StateBlock.Block(heroObject, HeroObjectMenuBlock.stateID);
                }
            }
            // draw event
            if (HeroObjectMenuBlock.typeID == 2)
            {
                EventBlock.Block(heroObject, HeroObjectMenuBlock.stateID, HeroObjectMenuBlock.eventID);
            }
            // draw action
            else if (HeroObjectMenuBlock.typeID == 3)
            {
                ActionBlock.Block(heroObject, HeroObjectMenuBlock.stateID, HeroObjectMenuBlock.eventID, HeroObjectMenuBlock.actionID);
            }
            // draw properties
            else if (HeroObjectMenuBlock.typeID == 4)
            {
                if (HeroObjectMenuBlock.propertyID == -1)
                {
                    // show properties tutorial page
                }
                else
                {
                    PropertiesBlock.Block(heroObject, HeroObjectMenuBlock.propertyID);
                }
            }
            // draw variables
            else if (HeroObjectMenuBlock.typeID == 5)
            {
                switch (HeroObjectMenuBlock.variableID)
                {
                case -1:
                    // show variable tutorial page
                    break;

                case 0:
                    IntListBlock.Block(heroObject);
                    break;

                case 1:
                    BoolListBlock.Block(heroObject);
                    break;

                case 2:
                    StringListBlock.Block(heroObject);
                    break;

                case 3:
                    GameObjectListBlock.Block(heroObject);
                    break;

                case 4:
                    HeroObjectListBlock.Block(heroObject);
                    break;

                case 5:
                    FloatListBlock.Block(heroObject);
                    break;

                case 6:
                    UnityObjectListBlock.Block(heroObject);
                    break;
                }
            }
            // draw globals
            else if (HeroObjectMenuBlock.typeID == 6)
            {
                switch (HeroObjectMenuBlock.globalID)
                {
                case -1:
                    // show variable tutorial page
                    break;

                case 0:
                    IntListBlock.Block(heroObject, true);
                    break;

                case 1:
                    BoolListBlock.Block(heroObject, true);
                    break;

                case 2:
                    StringListBlock.Block(heroObject, true);
                    break;

                case 3:
                    GameObjectListBlock.Block(heroObject, true);
                    break;

                case 4:
                    HeroObjectListBlock.Block(heroObject, true);
                    break;

                case 5:
                    FloatListBlock.Block(heroObject, true);
                    break;

                case 6:
                    UnityObjectListBlock.Block(heroObject, true);
                    break;
                }
            }
            // draw settings
            else if (HeroObjectMenuBlock.typeID == 7)
            {
                SettingsBlock.Block();
            }

            SimpleLayout.EndVertical();
            EditorGUILayout.EndScrollView();
        }