// Constructor used for duplication public Spell(Spell spell) { this.SpellName = spell.SpellName; this.SpellID = spell.SpellID; this.SpellDesc = spell.SpellDesc; this.SpellCastTime = spell.SpellCastTime; this.SpellCooldown = spell.SpellCooldown; this.SpellIcon = spell.SpellIcon; this.SpellIconPath = spell.SpellIconPath; this.SpellCastType = spell.SpellCastType; this.CasterAuras = spell.CasterAuras; this.TargetAuras = spell.TargetAuras; }
void GetSpellData() { spellName = EditorGUILayout.TextField("Name: ", selectedSpell.SpellName); spellID = EditorGUILayout.IntField("ID: ", selectedSpell.SpellID); spellDesc = EditorGUILayout.TextField("Description: ", selectedSpell.SpellDesc); spellCastTime = EditorGUILayout.DoubleField("Cast Time: ", selectedSpell.SpellCastTime); spellCooldown = EditorGUILayout.DoubleField("Cooldown: ", selectedSpell.SpellCooldown); spellIcon = EditorGUILayout.ObjectField("Icon: ", selectedSpell.GetIcon(), typeof(Texture2D), true) as Texture2D; spellCastType = (SpellCastType)EditorGUILayout.EnumPopup("Cast Type: ", selectedSpell.SpellCastType); casterAuras = selectedSpell.CasterAuras; CheckAuras(casterAuras); targetAuras = selectedSpell.TargetAuras; CheckAuras(targetAuras); }
void ShowCreateWindow() { editScrollPos = EditorGUILayout.BeginScrollView(editScrollPos, false, false, GUILayout.MinWidth(540), GUILayout.MinHeight(550)); spellName = EditorGUILayout.TextField("Name: ", spellName, GUILayout.Width(300)); spellID = EditorGUILayout.IntField("ID: ", spellID, GUILayout.Width(300)); spellDesc = EditorGUILayout.TextField("Description: ", spellDesc, GUILayout.Width(450)); spellCastTime = EditorGUILayout.DoubleField("Cast Time: ", spellCastTime, GUILayout.Width(300)); spellCooldown = EditorGUILayout.DoubleField("Cooldown: ", spellCooldown, GUILayout.Width(300)); spellIcon = EditorGUILayout.ObjectField("Icon: ", spellIcon, typeof(Texture2D), true, GUILayout.Width(450)) as Texture2D; spellCastType = (SpellCastType)EditorGUILayout.EnumPopup("Cast Type: ", spellCastType, GUILayout.Width(450)); DisplayAuraList(targetAuras, addedTargetAuraScrollPos, targetAuraScrollPos, "TARGET"); DisplayAuraList(casterAuras, addedCasterAuraScrollPos, casterAuraScrollPos, "CASTER"); EditorGUILayout.Space(); EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("Save", GUILayout.Width(150.0f))) { // Save this item to the database, either as a new item // or as an existing item. if (editorState == EditorState.Create) { SaveNewSpell(); } else { SaveExistingSpell(); } EditorUtility.SetDirty(spellDatabase); editorState = EditorState.Home; } if (GUILayout.Button("Cancel", GUILayout.Width(150.0f))) { EditorUtility.SetDirty(spellDatabase); editorState = EditorState.Home; } EditorGUILayout.EndHorizontal(); EditorGUILayout.EndScrollView(); }