void ThrowSwitch() { IThrow item = (IThrow)selected; GUILayout.BeginVertical("box"); GUILayout.Label("Attack", center); item.AttackElement = (Elements)EditorGUILayout.EnumPopup("Attack Element", item.AttackElement); item.MissileFlight = (MissileFlight)EditorGUILayout.EnumPopup("Missile Flight", item.MissileFlight); item.Piercing = EditorGUILayout.IntField("Armor piercing", item.Piercing); item.Piercing_Precent = EditorGUILayout.IntSlider("Armor piercing %", item.Piercing_Precent, 0, 100); item.Battle.dmg = EditorGUILayout.IntField("Dmg", item.Battle.dmg); if (item.Battle.dmg < 0) { item.Battle.dmg = 0; } item.Battle.dmg_dice = EditorGUILayout.IntField("Dmg dice", item.Battle.dmg_dice); if (item.Battle.dmg_dice < 0) { item.Battle.dmg_dice = 0; } GUILayout.Label(item.Battle.dmg + " - " + (item.Battle.dmg + item.Battle.dmg_dice)); item.Battle.crit_multiply = EditorGUILayout.FloatField("Crit multiply", item.Battle.crit_multiply); item.Battle.range = EditorGUILayout.FloatField("Range", item.Battle.range); item.AreaAttack = EditorGUILayout.Toggle("Area Attack", item.AreaAttack); if (item.AreaAttack) { item.AreaRange = EditorGUILayout.FloatField("Range", item.AreaRange); item.IgnoreObstacle = EditorGUILayout.Toggle("Ignore Obstacle", item.IgnoreObstacle); } else { item.AreaRange = 0; item.IgnoreObstacle = false; } GUILayout.EndVertical(); GUILayout.Space(20); GUILayout.BeginVertical("box"); EditorFunctions.ViewState(item.AtkState, "Attack State"); GUILayout.EndVertical(); GUILayout.Space(20); item.RemoveAllState = (TypeState)EditorGUILayout.EnumPopup("Remove All type state", item.RemoveAllState); GUILayout.Space(20); GUILayout.BeginVertical("box"); StatePanel(item.RemoveState, "State Remove"); GUILayout.EndVertical(); }
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.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 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; } }