Exemplo n.º 1
0
 private void OnGUI()
 {
     minSize = new Vector2(300, 300);
     maxSize = new Vector2(300, 300);
     EditorGUILayout.LabelField("Creation area", CustomStyles.subtitles);
     GUILayout.Space(10);
     if (GUILayout.Button("Create Melee Attack"))
     {
         MeleeAttackWindow.OpenWindow();
         Close();
     }
     GUILayout.Space(10);
     if (GUILayout.Button("Create Magic Attack"))
     {
         MagicAttackWindow.OpenWindow();
         Close();
     }
     GUILayout.Space(10);
     if (GUILayout.Button("Create Combination Attack"))
     {
         CombinationAttackWindow.OpenWindow();
         Close();
     }
     GUILayout.Space(22);
     EditorGUI.DrawRect(GUILayoutUtility.GetRect(100, 2), Color.black);
     GUILayout.Space(20);
     EditorGUILayout.LabelField("Edition area", CustomStyles.subtitles);
     GUILayout.Space(10);
     attack = (BaseAttack)EditorGUILayout.ObjectField("Attack", attack, typeof(BaseAttack), false);
     if (attack != null)
     {
         if (attack.isCombination)
         {
             if (GUILayout.Button("Edit Combination Attack"))
             {
                 LoadCombinationAttack.OpenWindow((CombinationAttack)attack);
                 Close();
             }
         }
         else
         {
             if (attack.isMeleeAttack)
             {
                 if (GUILayout.Button("Edit Melee Attack"))
                 {
                     LoadMeleeWindow.OpenWindow(attack);
                     Close();
                 }
             }
             else
             {
                 if (GUILayout.Button("Edit Magic Attack"))
                 {
                     LoadMagicWindow.OpenWindow(attack);
                     Close();
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
    public override void OnInspectorGUI()
    {
        EditorGUILayout.LabelField(attack.attackName, CustomStyles.titles);
        EditorGUILayout.Space();
        EditorGUILayout.LabelField(attack.attackDescription, CustomStyles.subtitles);
        EditorGUILayout.Space();
        EditorGUILayout.Space();
        if (attack.isMeleeAttack)
        {
            EditorGUILayout.LabelField("Melee attack", CustomStyles.bold);
        }
        else
        {
            if (attack.isBuff)
            {
                EditorGUILayout.LabelField("Buff", CustomStyles.bold);
            }
            else
            {
                EditorGUILayout.LabelField("Magic attack", CustomStyles.bold);
            }
        }
        EditorGUILayout.Space();
        if (attack.isAreaAttack)
        {
            EditorGUILayout.LabelField("Area Attack", CustomStyles.bold);
        }
        else
        {
            EditorGUILayout.LabelField("Single Attack", CustomStyles.bold);
        }
        EditorGUILayout.Space();
        if (!attack.isBuff)
        {
            EditorGUILayout.LabelField("Base Damage: " + attack.baseDamage, CustomStyles.bold);
        }
        if (!attack.isMeleeAttack)
        {
            EditorGUILayout.LabelField("Mana Cost: " + attack.manaCost, CustomStyles.bold);
        }
        EditorGUILayout.Space();
        EditorGUILayout.LabelField("Number of attacks: " + attack.attackQty, CustomStyles.bold);
        EditorGUILayout.Space();
        EditorGUILayout.LabelField("Level Required: " + attack.levelRequirement, CustomStyles.bold);
        EditorGUILayout.Space();
        EditorGUILayout.LabelField("Job Required: " + attack.jobsRequirement, CustomStyles.bold);
        EditorGUILayout.Space();
        EditorGUILayout.Space();

        EditorGUILayout.LabelField("Colors: ", CustomStyles.bold);
        if (attack.listOfColors.Count <= 0)
        {
            EditorGUILayout.LabelField("None", CustomStyles.bold);
        }
        else
        {
            foreach (var actualColor in attack.listOfColors)
            {
                int index = attack.listOfColors.IndexOf(actualColor);
                EditorGUILayout.LabelField("" + actualColor, CustomStyles.bold);
            }
        }
        EditorGUILayout.Space();
        EditorGUILayout.Space();

        EditorGUILayout.LabelField("Tags: ", CustomStyles.bold);
        if (attack.listOfTags.Count <= 0)
        {
            EditorGUILayout.LabelField("None", CustomStyles.bold);
        }
        else
        {
            foreach (var actualTag in attack.listOfTags)
            {
                int index = attack.listOfTags.IndexOf(actualTag);
                EditorGUILayout.LabelField("" + actualTag, CustomStyles.bold);
            }
        }
        EditorGUILayout.Space();
        EditorGUILayout.Space();

        if (GUILayout.Button("Edit"))
        {
            if (attack.isMeleeAttack)
            {
                LoadMeleeWindow.OpenWindow(attack);
            }
            else
            {
                LoadMagicWindow.OpenWindow(attack);
            }
        }
    }