void AccessoriesSwitch() { IAccessories accessories = (IAccessories)selected; GUILayout.Space(20); GUILayout.BeginHorizontal(); Buttons(); if (GUILayout.Button("State Resist")) { typeEdit = 6; } GUILayout.EndHorizontal(); switch (typeEdit) { case 1: EditorFunctions.ViewBase(accessories.Stats.Base); break; case 2: EditorFunctions.ViewBattle(accessories.Stats.Battle); break; case 3: EditorFunctions.ViewAbility(accessories.Stats.Ability); break; case 4: EditorFunctions.ViewResist(accessories.Stats.Resistance); break; case 5: EditorFunctions.ViewOther(accessories.Stats.Other); break; case 6: EditorFunctions.ViewState(accessories.Stats.ResistState, "State resist"); break; case 7: EditorFunctions.ViewSkills(); 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.States.RemoveAt(index); selected = null; index = 0; } GUILayout.EndHorizontal(); GUILayout.Space(20); GUILayout.BeginHorizontal(); GUILayout.BeginVertical(); selected.Name = EditorGUILayout.TextField("Name", selected.Name); selected.Restriction = (Restriction)EditorGUILayout.EnumPopup("Restriction", selected.Restriction); selected.TypeState = (TypeState)EditorGUILayout.EnumPopup("Type", selected.TypeState); selected.DoubleEffect = (StateDoubleEffect)EditorGUILayout.EnumPopup("Double Effect", selected.DoubleEffect); selected.Remove_by_time = (StateRemoveByTime)EditorGUILayout.EnumPopup("Remove by time", selected.Remove_by_time); switch (selected.Remove_by_time) { case StateRemoveByTime.None: selected.Min = 0; selected.Max = 0; break; case StateRemoveByTime.Turn: GUILayout.BeginHorizontal(); selected.Min = EditorGUILayout.IntField("Min", selected.Min); selected.Max = EditorGUILayout.IntField("Max", selected.Max); GUILayout.EndHorizontal(); if (selected.Max < selected.Min) { selected.Max = selected.Min; } break; } selected.Remove_by_Damage = EditorGUILayout.Toggle("Remove by damage", selected.Remove_by_Damage); if (selected.Remove_by_Damage) { GUILayout.BeginHorizontal(); selected.chance_Remove = EditorGUILayout.IntSlider("Rate to remove", selected.chance_Remove, 0, 100); GUILayout.Label("%"); GUILayout.EndHorizontal(); } else { selected.chance_Remove = 0; } GUILayout.Space(20f); selected.recover.hp = EditorGUILayout.IntField("Recover HP", selected.recover.hp); selected.recover.mp = EditorGUILayout.IntField("Recover MP", selected.recover.mp); selected.recover.precent_hp = EditorGUILayout.IntSlider("Recover HP %", selected.recover.precent_hp, 0, 100); selected.recover.precent_mp = EditorGUILayout.IntSlider("Recover MP %", selected.recover.precent_mp, 0, 100); GUILayout.EndVertical(); GUILayout.Label(""); selected.Icon = (Sprite)EditorGUILayout.ObjectField("Icon", selected.Icon, typeof(Sprite), true); GUILayout.EndHorizontal(); 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.ViewSkills(); break; case 7: ViewBasePrecent(selected.Precent_Stats.Base); break; case 8: ViewBattlePrecent(selected.Precent_Stats.Battle); break; case 9: ViewOtherPrecent(selected.Precent_Stats.Other); break; default: break; } GUILayout.EndVertical(); GUILayout.EndScrollView(); } }
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(); } }
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.Traits.RemoveAt(index); selected = null; } GUILayout.EndHorizontal(); GUILayout.Space(20); GUILayout.BeginHorizontal(); GUILayout.BeginVertical(); selected.Name = EditorGUILayout.TextField("Name", selected.Name); GUILayout.Space(20); selected.canAddToKnowledge = EditorGUILayout.Toggle("Can add to knowledge", selected.canAddToKnowledge); if (selected.canAddToKnowledge) { GUILayout.BeginHorizontal(); selected.randomRate = EditorGUILayout.IntField("Trait Rate", selected.randomRate); GUILayout.Label(CalculatePrecent() + "%"); GUILayout.EndHorizontal(); } GUILayout.EndVertical(); GUILayout.Label(""); selected.Icon = (Sprite)EditorGUILayout.ObjectField("Icon", selected.Icon, typeof(Sprite), true); GUILayout.EndHorizontal(); 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.ViewSkills(); break; case 7: ViewBasePrecent(selected.Precent_Stats.Base); break; case 8: ViewBattlePrecent(selected.Precent_Stats.Battle); break; case 9: ViewOtherPrecent(selected.Precent_Stats.Other); break; case 10: EditorFunctions.ViewState(selected.Stats.ResistState, "State resist"); break; default: break; } GUILayout.EndVertical(); GUILayout.EndScrollView(); } }
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 ArmorSwitch() { IArmor armor = (IArmor)selected; armor.ACategory = (IArmorCategory)EditorGUILayout.EnumPopup("Category", armor.ACategory); armor.Weight = (Weight)EditorGUILayout.EnumPopup("Weight", armor.Weight); GUILayout.BeginHorizontal(); GUILayout.Label("Runes: " + armor.Runes.Count); if (GUILayout.Button("+")) { armor.Runes.Add(-1); } if (GUILayout.Button("-") && armor.Runes.Count > 0) { armor.Runes.RemoveAt(armor.Runes.Count - 1); } GUILayout.EndHorizontal(); GUILayout.Space(20); GUILayout.BeginHorizontal(); Buttons(); if (GUILayout.Button("State Resist")) { typeEdit = 6; } if (GUILayout.Button("Requires")) { typeEdit = 8; } GUILayout.EndHorizontal(); switch (typeEdit) { case 1: EditorFunctions.ViewBase(armor.Stats.Base); break; case 2: armor.Stats.Battle.armor_phisical = EditorGUILayout.IntField("Armor Phisical", armor.Stats.Battle.armor_phisical); armor.Stats.Battle.armor_magicial = EditorGUILayout.IntField("Armor Magicial", armor.Stats.Battle.armor_magicial); EditorFunctions.ViewBattle(armor.Stats.Battle); break; case 3: EditorFunctions.ViewAbility(armor.Stats.Ability); break; case 4: EditorFunctions.ViewResist(armor.Stats.Resistance); break; case 5: EditorFunctions.ViewOther(armor.Stats.Other); break; case 6: EditorFunctions.ViewState(armor.Stats.ResistState, "State resist"); break; case 7: EditorFunctions.ViewSkills(); break; case 8: EditorFunctions.ViewBase(armor.Requires); break; } }
void WeaponSwitch() { IWeapon weapon = (IWeapon)selected; weapon.WCategory = (IWeaponCategory)EditorGUILayout.EnumPopup("Category", weapon.WCategory); switch (weapon.WCategory) //type { case IWeaponCategory.Bow: case IWeaponCategory.Rifle: case IWeaponCategory.Shotgun: case IWeaponCategory.Staff: weapon.WType = IWeaponType.Two_handed; GUILayout.Label("Type Two handed"); break; default: weapon.WType = (IWeaponType)EditorGUILayout.EnumPopup("Type", weapon.WType); break; } switch (weapon.WCategory) //missile flight { case IWeaponCategory.Bow: case IWeaponCategory.Crossbow: weapon.MissileFlight = MissileFlight.curve; break; case IWeaponCategory.Pistol: case IWeaponCategory.Rifle: case IWeaponCategory.Shotgun: weapon.MissileFlight = MissileFlight.simply; break; default: weapon.MissileFlight = MissileFlight.none; break; } GUILayout.Label("MissileFlight: " + weapon.MissileFlight); switch (weapon.WCategory) { case IWeaponCategory.Staff: case IWeaponCategory.Wand: weapon.FullAttackElement = (Elements)EditorGUILayout.EnumPopup("Element", weapon.FullAttackElement); break; default: weapon.FullAttackElement = Elements.Physical; break; } weapon.Weight = (Weight)EditorGUILayout.EnumPopup("Weight", weapon.Weight); GUILayout.BeginHorizontal(); GUILayout.Label("Runes: " + weapon.Runes.Count); if (GUILayout.Button("+")) { weapon.Runes.Add(-1); } if (GUILayout.Button("-") && weapon.Runes.Count > 0) { weapon.Runes.RemoveAt(weapon.Runes.Count - 1); } GUILayout.EndHorizontal(); weapon.Piercing = EditorGUILayout.IntField("Armor piercing", weapon.Piercing); if (weapon.Piercing < 0) { weapon.Piercing = 0; } if (weapon.Piercing != 0) { weapon.Piercing_Precent = 0; } weapon.Piercing_Precent = EditorGUILayout.IntSlider("Armor piercing %", weapon.Piercing_Precent, 0, 100); if (weapon.Piercing_Precent != 0) { weapon.Piercing = 0; } GUILayout.Space(20); GUILayout.BeginHorizontal(); Buttons(); if (GUILayout.Button("Requires")) { typeEdit = 8; } if (GUILayout.Button("Elements")) { typeEdit = 9; } if (GUILayout.Button("Atk state")) { typeEdit = 6; } switch (weapon.WCategory) { case IWeaponCategory.Bow: case IWeaponCategory.Crossbow: case IWeaponCategory.Pistol: case IWeaponCategory.Rifle: case IWeaponCategory.Shotgun: if (GUILayout.Button("Ammunition")) { typeEdit = 10; } break; default: weapon.Ammunition = null; if (typeEdit == 10) { typeEdit = 0; } break; } switch (weapon.WCategory) { case IWeaponCategory.Bow: case IWeaponCategory.Crossbow: weapon.MissileFlight = MissileFlight.curve; break; case IWeaponCategory.Pistol: case IWeaponCategory.Rifle: case IWeaponCategory.Shotgun: case IWeaponCategory.Wand: weapon.MissileFlight = MissileFlight.simply; break; default: weapon.MissileFlight = MissileFlight.none; break; } GUILayout.EndHorizontal(); switch (typeEdit) { case 1: EditorFunctions.ViewBase(weapon.Stats.Base); break; case 2: weapon.Stats.Battle.dmg = EditorGUILayout.IntField("Dmg", weapon.Stats.Battle.dmg); if (weapon.Stats.Battle.dmg < 0) { weapon.Stats.Battle.dmg = 0; } weapon.Stats.Battle.dmg_dice = EditorGUILayout.IntField("Dmg dice", weapon.Stats.Battle.dmg_dice); if (weapon.Stats.Battle.dmg_dice < 0) { weapon.Stats.Battle.dmg_dice = 0; } GUILayout.Label(weapon.Stats.Battle.dmg + " - " + (weapon.Stats.Battle.dmg + weapon.Stats.Battle.dmg_dice)); weapon.Stats.Battle.crit_multiply = EditorGUILayout.FloatField("Crit multiply", weapon.Stats.Battle.crit_multiply); weapon.Stats.Battle.range = EditorGUILayout.FloatField("Range", weapon.Stats.Battle.range); weapon.Stats.Battle.armor_phisical = EditorGUILayout.IntField("Armor Phisical", weapon.Stats.Battle.armor_phisical); weapon.Stats.Battle.armor_magicial = EditorGUILayout.IntField("Armor Magicial", weapon.Stats.Battle.armor_magicial); EditorFunctions.ViewBattle(weapon.Stats.Battle); break; case 3: EditorFunctions.ViewAbility(weapon.Stats.Ability); break; case 4: EditorFunctions.ViewResist(weapon.Stats.Resistance); break; case 5: EditorFunctions.ViewOther(weapon.Stats.Other); break; case 6: GUILayout.BeginVertical("box"); EditorFunctions.ViewState(weapon.Stats.AtkState, "Attack State"); GUILayout.EndVertical(); break; case 7: EditorFunctions.ViewSkills(); break; case 8: EditorFunctions.ViewBase(weapon.Requires); break; case 9: ElementsPanel(weapon.OtherAttackElement); break; case 10: AmmunitionPanel(weapon); break; } }
void RuneSwitch() { IRune rune = (IRune)selected; rune.Type = (IRune.TypeRune)EditorGUILayout.EnumPopup("Type", rune.Type); GUILayout.Space(20); GUILayout.BeginHorizontal(); rune.Category = ItemCategory.Rune; Buttons(); switch (rune.Type) { case IRune.TypeRune.Weapon: if (GUILayout.Button("Elements")) { typeEdit = 8; } if (GUILayout.Button("Atk state")) { typeEdit = 6; } break; case IRune.TypeRune.Armor: rune.Elements = new List <AttackElementRate>(); if (typeEdit == 8) { typeEdit = 0; } if (GUILayout.Button("Resist state")) { typeEdit = 9; } break; } GUILayout.EndHorizontal(); switch (typeEdit) { case 1: EditorFunctions.ViewBase(rune.Stats.Base); break; case 2: EditorFunctions.ViewBattle(rune.Stats.Battle); break; case 3: EditorFunctions.ViewAbility(rune.Stats.Ability); break; case 4: EditorFunctions.ViewResist(rune.Stats.Resistance); break; case 5: EditorFunctions.ViewOther(rune.Stats.Other); break; case 6: GUILayout.BeginVertical("box"); EditorFunctions.ViewState(rune.Stats.AtkState, "Attack State"); GUILayout.EndVertical(); break; case 7: EditorFunctions.ViewSkills(); break; case 8: ElementsPanel(rune.Elements); break; case 9: GUILayout.BeginVertical("box"); EditorFunctions.ViewState(rune.Stats.ResistState, "Resist State"); GUILayout.EndVertical(); break; } }