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(); } } } } }
public override void OnInspectorGUI() { EditorGUILayout.LabelField(attack.attackName, CustomStyles.titles); EditorGUILayout.Space(); EditorGUILayout.LabelField(attack.attackDescription, CustomStyles.subtitles); EditorGUILayout.Space(); EditorGUILayout.Space(); EditorGUILayout.LabelField("Combination attack", CustomStyles.bold); EditorGUILayout.Space(); if (attack.isBuff) { EditorGUILayout.LabelField("Buff", 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); } EditorGUILayout.Space(); EditorGUILayout.LabelField("Number of attacks: " + attack.attackQty, CustomStyles.bold); EditorGUILayout.Space(); EditorGUILayout.LabelField("Level Required: " + attack.levelRequirement, CustomStyles.bold); EditorGUILayout.LabelField("Job Required: " + attack.jobsRequirement, CustomStyles.bold); EditorGUILayout.Space(); EditorGUILayout.Space(); EditorGUILayout.LabelField("Attacks required: ", CustomStyles.bold); foreach (var actualAttack in attack.combinationOfAttacks) { int index = attack.combinationOfAttacks.IndexOf(actualAttack); EditorGUILayout.LabelField(actualAttack.attackName, CustomStyles.bold); } EditorGUILayout.Space(); EditorGUILayout.Space(); EditorGUILayout.LabelField("Colors: ", CustomStyles.bold); foreach (var actualColor in attack.listOfColors) { int index = attack.listOfColors.IndexOf(actualColor); EditorGUILayout.LabelField(actualColor + "", CustomStyles.bold); } EditorGUILayout.Space(); EditorGUILayout.Space(); if (GUILayout.Button("Edit")) { LoadCombinationAttack.OpenWindow(attack); } }