private void CopyHealProperty(HealProperty prop) { eStat scaling = new eStat(); scaling = prop.scaleFactor; MinMaxValue[] values = new MinMaxValue[5]; for (int i = 0; i < 5; i++) { MinMaxValue val = new MinMaxValue(prop.healPerLevel [i].min, prop.healPerLevel [i].max); values [i] = val; } bool targetCaster = prop.targetCasterOverride; bool affectCaster = prop.affectsCaster; bool allies = prop.affectsAllyPlayers; bool allySummon = prop.affectsAllySummons; bool enemies = prop.affectsEnemyPlayers; bool enemySummon = prop.affectsAllySummons; HealProperty newProp = new HealProperty(); newProp.scaleFactor = scaling; newProp.healPerLevel = values; newProp.targetCasterOverride = targetCaster; newProp.affectsCaster = affectCaster; newProp.affectsAllyPlayers = allies; newProp.affectsAllySummons = allySummon; newProp.affectsEnemyPlayers = enemies; newProp.affectsEnemySummons = enemySummon; ability.critHealEffects.Add(newProp); }
//Heal property. void DrawHealProperty(HealProperty prop, int index, bool crit) { int propID = crit ? critTotal + total : total; EditorGUILayout.BeginVertical("box"); GUILayout.Space(5); EditorGUILayout.BeginHorizontal(); GUILayout.Space(5); EditorGUILayout.LabelField("Heal:", EditorStyles.boldLabel, GUILayout.MaxWidth(100)); EditorGUILayout.LabelField(prop.healPerLevel [showLevel - 1].min + " - " + prop.healPerLevel [showLevel - 1].max, EditorStyles.boldLabel, GUILayout.MaxWidth(60)); EditorGUILayout.LabelField("at level " + showLevel, GUILayout.MinWidth(60)); DisplayScaleFactor(prop.scaleFactor); if (editEffectIndex == propID) { if (GUILayout.Button("Hide", EditorStyles.miniButtonLeft, GUILayout.Width(60))) { editEffectIndex = int.MaxValue; } } else { if (GUILayout.Button("Show", EditorStyles.miniButtonLeft, GUILayout.Width(60))) { editEffectIndex = propID; } } if (GUILayout.Button("Remove", EditorStyles.miniButtonRight, GUILayout.Width(60))) { if (!crit) { ability.healEffects.RemoveAt(index); total--; } else { ability.critHealEffects.RemoveAt(index); critTotal--; } return; } GUILayout.Space(5); EditorGUILayout.EndHorizontal(); GUILayout.Space(2); if (editEffectIndex == propID) { GUILayout.Space(4); EditorGUILayout.BeginHorizontal(); GUILayout.Space(4); EditorGUILayout.LabelField("Scaling:", GUILayout.Width(60)); prop.scaleFactor = (eStat)EditorGUILayout.EnumPopup(prop.scaleFactor, GUILayout.Width(80), GUILayout.Height(15)); EditorGUILayout.EndHorizontal(); GUILayout.Space(2); for (int i = 0; i < 5; i++) { EditorGUILayout.BeginHorizontal(); GUILayout.Space(4); EditorGUILayout.LabelField("Level " + (i + 1) + ":", GUILayout.Width(60)); GUILayout.Label("Min Heal:"); prop.healPerLevel[i].min = EditorGUILayout.IntField(prop.healPerLevel[i].min, GUILayout.Width(40)); GUILayout.Space(60); GUILayout.Label("Max Heal:"); prop.healPerLevel[i].max = EditorGUILayout.IntField(prop.healPerLevel[i].max, GUILayout.Width(40)); GUILayout.Space(60); EditorGUILayout.EndHorizontal(); } GUILayout.Space(5); } //Affected Units. DrawAffectedUnitsPanel(propID, ref prop.targetCasterOverride, ref prop.affectsCaster, ref prop.affectsAllyPlayers, ref prop.affectsAllySummons, ref prop.affectsEnemyPlayers, ref prop.affectsEnemySummons); EditorGUILayout.EndVertical(); }