Beispiel #1
0
    void ConsumeSwitch()
    {
        IConsume consume = (IConsume)selected;

        consume.RemoveAllState = (TypeState)EditorGUILayout.EnumPopup("Remove All type state", consume.RemoveAllState);
        GUILayout.Space(20);
        GUILayout.BeginHorizontal();
        Buttons();
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        if (GUILayout.Button("Add State"))
        {
            typeEdit = 10;
        }
        if (GUILayout.Button("Remove State"))
        {
            typeEdit = 11;
        }
        if (GUILayout.Button("Add Trait"))
        {
            typeEdit = 12;
        }
        if (GUILayout.Button("Remove Trait"))
        {
            typeEdit = 13;
        }
        if (GUILayout.Button("Recover"))
        {
            typeEdit = 14;
        }
        GUILayout.EndHorizontal();
        switch (typeEdit)
        {
        case 1:
            EditorFunctions.ViewBase(consume.Stats.Base);
            break;

        case 2:
            EditorFunctions.ViewBattle(consume.Stats.Battle);
            break;

        case 3:
            EditorFunctions.ViewAbility(consume.Stats.Ability);
            break;

        case 4:
            EditorFunctions.ViewResist(consume.Stats.Resistance);
            break;

        case 5:
            EditorFunctions.ViewOther(consume.Stats.Other);
            break;

        case 6:
            //EditorFunctions.ViewState();
            break;

        case 7:
            EditorFunctions.ViewSkills();
            break;

        case 10:
            StatePanel(consume.AddState, "States add");
            break;

        case 11:
            StatePanel(consume.RemoveState, "States remove");
            break;

        case 12:
            EditorFunctions.TraitPanel(consume.AddTrait, "Traits add");
            break;

        case 13:
            EditorFunctions.TraitPanel(consume.RemoveTrait, "Traits remove");
            break;

        case 14:
            RecoverStats(consume.Recover);
            break;
        }
    }
    void Content()
    {
        if (selected != null)
        {
            scrollContent = GUILayout.BeginScrollView(scrollContent, GUILayout.Height(position.height));
            GUILayout.BeginVertical("box");

            GUILayout.BeginHorizontal();
            GUILayout.Label("ID: " + index);
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Remove", GUILayout.Width(100)))
            {
                my.Races.RemoveAt(index);
                selected = null;
            }
            GUILayout.EndHorizontal();

            GUILayout.Space(20);

            GUILayout.BeginHorizontal();
            selected.Name = EditorGUILayout.TextField("Name", selected.Name);
            GUILayout.Label("");
            selected.awakenChance = EditorGUILayout.IntField("Awaken Chance", selected.awakenChance);
            GUILayout.Label("%");
            selected.randomRate = EditorGUILayout.IntField("Race Rate", selected.randomRate);
            GUILayout.Label(CalculatePrecent() + "%");
            GUILayout.EndHorizontal();
            GUILayout.Label("Description");
            selected.Description = EditorGUILayout.TextArea(selected.Description, GUILayout.MinHeight(50));
            GUILayout.Space(20);
            GUILayout.BeginHorizontal();
            Buttons();
            GUILayout.EndHorizontal();
            switch (typeEdit)
            {
            case 1:
                EditorFunctions.ViewBase(selected.Stats.Base);
                break;

            case 2:
                ViewBattle();
                break;

            case 3:
                EditorFunctions.ViewAbility(selected.Stats.Ability);
                break;

            case 4:
                EditorFunctions.ViewResist(selected.Stats.Resistance);
                break;

            case 5:
                EditorFunctions.ViewOther(selected.Stats.Other);
                break;

            case 6:
                EditorFunctions.ViewState(selected.Stats.ResistState, "State resist");
                break;

            case 7:
                EditorFunctions.TraitPanel(selected.Traits, "Traits");
                break;

            case 8:
                EditorFunctions.ViewSkills();
                break;

            default:
                break;
            }
            GUILayout.EndVertical();
            GUILayout.EndScrollView();
        }
    }
Beispiel #3
0
    void Content()
    {
        if (selected != null)
        {
            scrollContent = GUILayout.BeginScrollView(scrollContent, GUILayout.Height(position.height));
            GUILayout.BeginVertical("box");

            GUILayout.BeginHorizontal();
            GUILayout.Label("ID: " + index);
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Remove", GUILayout.Width(100)))
            {
                my.Classes.RemoveAt(index);
                selected = null;
            }
            GUILayout.EndHorizontal();

            GUILayout.Space(20);

            GUILayout.BeginHorizontal();
            selected.Name = EditorGUILayout.TextField("Name", selected.Name);
            GUILayout.Label("");
            selected.Icon = (Sprite)EditorGUILayout.ObjectField("Icon", selected.Icon, typeof(Sprite), true);
            GUILayout.Label("");
            selected.randomRate = EditorGUILayout.IntField("Class Rate", selected.randomRate);
            GUILayout.Label(CalculatePrecent() + "%");
            GUILayout.EndHorizontal();
            selected.canUseMageStaff = EditorGUILayout.Toggle("Can use magic weapon", selected.canUseMageStaff);
            GUILayout.Space(20);
            GUILayout.BeginHorizontal();
            Buttons();
            GUILayout.EndHorizontal();
            switch (typeEdit)
            {
            case 1:
                EditorFunctions.ViewBase(selected.Stats.Base);
                break;

            case 2:
                EditorFunctions.ViewBattle(selected.Stats.Battle);
                break;

            case 3:
                EditorFunctions.ViewAbility(selected.Stats.Ability);
                break;

            case 4:
                EditorFunctions.ViewResist(selected.Stats.Resistance);
                break;

            case 5:
                EditorFunctions.ViewOther(selected.Stats.Other);
                break;

            case 6:
                EditorFunctions.ViewState(selected.Stats.ResistState, "State resist");
                break;

            case 7:
                EditorFunctions.TraitPanel(selected.Traits, "Traits");
                break;

            case 8:
                EditorFunctions.ViewSkills();
                break;

            case 9:
                ListRaceRequired();
                break;

            default:
                break;
            }
            GUILayout.EndVertical();
            GUILayout.EndScrollView();
        }
    }