//Unequips the piece of armor in the given slot public void UnequipArmor(ArmorSlot slotToRemove_) { //Making sure there's a free inventory slot first if (PartyGroup.globalReference.inventory.CheckForEmptySlot() < 1) { return; } //Finding the correct slot to equip the armor, adding it to the inventory, and setting the slot to null switch (slotToRemove_) { case ArmorSlot.Head: PartyGroup.globalReference.inventory.AddItemToInventory(this.helm.GetComponent <Item>()); this.helm = null; break; case ArmorSlot.Body: PartyGroup.globalReference.inventory.AddItemToInventory(this.body.GetComponent <Item>()); this.body = null; break; case ArmorSlot.Trinket: PartyGroup.globalReference.inventory.AddItemToInventory(this.trinket.GetComponent <Item>()); this.trinket = null; break; default: break; } }
private void SetArmorSlots() { Transform transform = this.m_Player.transform.FindDeepChild("mixamorig:ArmTwist2.L"); DebugUtils.Assert(transform, true); ArmorSlot armorSlot = transform.gameObject.AddComponent <ArmorSlot>(); armorSlot.m_Limb = Limb.LArm; this.m_ArmorSlots.Add(armorSlot); this.m_LimbMap[0].m_Slot = armorSlot; Transform transform2 = this.m_Player.transform.FindDeepChild("mixamorig:ArmTwist2.R"); DebugUtils.Assert(transform2, true); armorSlot = transform2.gameObject.AddComponent <ArmorSlot>(); armorSlot.m_Limb = Limb.RArm; this.m_ArmorSlots.Add(armorSlot); this.m_LimbMap[1].m_Slot = armorSlot; Transform transform3 = this.m_Player.transform.FindDeepChild("Wound17"); DebugUtils.Assert(transform3, true); armorSlot = transform3.gameObject.AddComponent <ArmorSlot>(); armorSlot.m_Limb = Limb.LLeg; this.m_ArmorSlots.Add(armorSlot); this.m_LimbMap[2].m_Slot = armorSlot; Transform transform4 = this.m_Player.transform.FindDeepChild("Wound34"); DebugUtils.Assert(transform4, true); armorSlot = transform4.gameObject.AddComponent <ArmorSlot>(); armorSlot.m_Limb = Limb.RLeg; this.m_ArmorSlots.Add(armorSlot); this.m_LimbMap[3].m_Slot = armorSlot; }
public ItemTag GenerateArmor(ArmorSlot slot) { ItemTag subItem = new ItemTag(this.Item, this.Amount); //Set the item type based on the slot subItem.Item = $"{ArmorType.ToString()}_{slot.ToString()}".ToLower(); subItem.Name = Name.Replace("{slot}", $"{slot}"); List <string> loreList = new List <string>(); if (Lore != null) { foreach (var loreItem in Lore) { loreList.Add(loreItem.Replace("{slot}", $"{slot}")); } subItem.Lore = loreList; } if (ColorData != null) { subItem.Colors = ColorData.GetColorForSlot(slot); } subItem.Enchants = Enchants?.Where(e => e.getEnchantCompatabilityWithSlot(slot)).ToList(); return(subItem); }
public Armor(string armorName, string armorType, int price, float weight, ArmorSlot slot, int defenseValue, int defenseModifier, params Type[] allowableClasses) : base(armorName, armorType, price, weight, allowableClasses) { Slot = slot; DefenseValue = defenseValue; DefenseModifier = defenseModifier; }
public void OnArmorInsert(ArmorSlot slot, Item item) { ((Armor)item).m_Limb = slot.m_Limb; item.ItemsManagerUnregister(); item.transform.SetParent(slot.transform); Physics.IgnoreCollision(this.m_Player.m_Collider, item.GetComponent <Collider>()); Renderer[] componentsDeepChild = General.GetComponentsDeepChild <Renderer>(item.gameObject); for (int i = 0; i < componentsDeepChild.Length; i++) { componentsDeepChild[i].enabled = false; } ArmorInfo armorInfo = (ArmorInfo)item.m_Info; ArmorData armorData = this.m_LimbMap[(int)slot.m_Limb]; armorData.m_MeshMap[(int)armorInfo.m_ArmorType].SetActive(true); armorData.m_Mesh = armorData.m_MeshMap[(int)armorInfo.m_ArmorType]; armorData.m_AttachedArmor = item; armorData.m_AttachedArmorOrigCollCenter = armorData.m_AttachedArmor.m_BoxCollider.center; armorData.m_AttachedArmorOrigCollSize = armorData.m_AttachedArmor.m_BoxCollider.size; armorData.m_AttachedArmor.m_BoxCollider.center = armorData.m_AttachedArmorCollCenter; armorData.m_AttachedArmor.m_BoxCollider.size = armorData.m_AttachedArmorCollSize; armorData.m_ArmorType = armorInfo.m_ArmorType; armorData.m_Absorption = armorInfo.m_Absorption; armorData.m_Health = armorInfo.m_Health; HUDBodyInspection.Get().m_ArmorEnabled = true; this.SetMeshesVisible(HUDBodyInspection.Get().m_ArmorEnabled); BodyInspectionController.Get().OnArmorAttached(slot.m_Limb); }
private void DrawSlotInfo(Rect rect, ModuleSlot <MKArmorModule> slot, ArmorSlot armorSlot) { Widgets.DrawAtlas(rect, Widgets.ButtonSubtleAtlas); if (slot.Module != null) { GUI.DrawTexture(new Rect(rect.x + 5, rect.y + 5, 100, 100), slot.Module.def.IconImage); string fullDesc = $"{slot.Module.def.LabelCap}\n\n{slot.Module.def.description}\n{slot.Module.StatDescription()}"; TooltipHandler.TipRegion(rect, new TipSignal(fullDesc, 4321211)); if (Widgets.ButtonInvisible(rect)) { Find.WindowStack.Add(new FloatMenu(new List <FloatMenuOption>() { new FloatMenuOption("Station_UnloadModule".Translate(), delegate { if (CellFinder.TryFindRandomCellNear(mkStation.Position, mkStation.Map, 3, null, out IntVec3 result)) { GenSpawn.Spawn(slot.Item, result, mkStation.Map); slot.Item = null; slot.Module = null; mkStation.ContainedArmor.Notify_ModulesChanges(); } else { Messages.Message("NotEnoughSpace".Translate(), MessageTypeDefOf.NeutralEvent, false); } }) }));
public static void AddRandomArmor(LivingObject living, ArmorSlot slot) { var itemIDs = Items.GetItemInfos(ItemCategory.Armor).Where(ii => ii.ArmorInfo.Slot == slot).ToArray(); var itemID = itemIDs[Helpers.GetRandomInt(itemIDs.Length)].ID; AddEquipment(living, itemID); }
// Constructor to define specific armor slot for players, vendors public Armor(int level, ArmorType armorGroup, ArmorSlot armorCategory) { Level = level; ArmorGroup = armorGroup; ArmorCategory = armorCategory; // Base armor rating before random attribute or armor type ArmorRating = ArmorCategory switch { ArmorSlot.Back => 1, ArmorSlot.Chest => 5, ArmorSlot.Head => 2, ArmorSlot.Legs => 3, ArmorSlot.Waist => 2, ArmorSlot.Wrist => 1, ArmorSlot.Hands => 1, _ => throw new ArgumentOutOfRangeException() }; // Add armor type armor rating to base value ArmorRating += ArmorGroup switch { ArmorType.Cloth => 0, ArmorType.Leather => 2, ArmorType.Plate => 4, _ => throw new ArgumentOutOfRangeException() }; // Add random attribute to armor rating ArmorRating += GameHelper.GetRandomNumber(2, 4); // Add level adjustment to armor rating ArmorRating += (level - 1) * 3; ItemValue = ArmorRating; Durability = 100; BuildArmorName(); SetArmorWeight(); Desc = $"A {Name}."; }
public ArmorMetadata(float armorRating, int durability, MetalType metal, ItemTypesServer.ItemTypeRaw itemType, ArmorSlot slot) { ArmorRating = armorRating; Durability = durability; Metal = metal; ItemType = itemType; Slot = slot; }
public ArmorBase( string description, int valueInGold, ArmorSlot slot) : base(description, valueInGold, ItemCategory.armor) { Slot = slot; }
public ArmorMetadata(float armorRating, int durability, string name, ItemTypesServer.ItemTypeRaw itemType, ArmorSlot slot) { ArmorRating = armorRating; Durability = durability; this.name = name; ItemType = itemType; Slot = slot; }
public void Equip(Armor armor) { ArmorSlot slot = armorSlots[armor.type]; if (slot != null && armor != null) { slot.Set(armor); } }
public void UnEquip(ArmorType type) { ArmorSlot slot = armorSlots[type]; if (slot != null && slot.isOccupied) { slot.Set(null); } }
public void EquipArmor(ArmorType type, Armor armor) { ArmorSlot slot = getArmorSlotByType(type); if (slot != null) { slot.Set(armor); } }
private void pickItemForSlot(ArmorSlot slot, int i) { UIQuickMenuPickArmor page = Instantiate(pickArmorPrefab); page.slot = slot; selectedIndex = i; menu.NavigateInto(page); }
/// <summary>Weapon constructor. /// <para>Increments automatically the id.</para> /// <para>Set the armor's name.</para> /// <para>Set the armor's description.</para> /// <para>Set the armor's level.</para> /// <para>Set the armor's durability.</para> /// <para>Set the armor's defense.</para> /// <para>Set the armor's slot.</para> /// <para>Set the armor's type.</para> /// <para>Set the armor's stats.</para> /// </summary> public Armor(string name, string description, int level, int durability, int defense, ArmorSlot slot, ArmorType type, Dictionary <Stat, int> stats) { Id = System.Threading.Interlocked.Increment(ref idCounter); Name = name; Description = description; Level = level; Durability = durability; Defense = defense; armorSlot = slot; armorType = type; Stats = stats; }
public void OnDragItemToSlot(ArmorSlot slot, Item item) { ArmorData armorData = this.m_LimbMap[(int)slot.m_Limb]; ArmorInfo armorInfo = (ArmorInfo)item.m_Info; armorData.m_MeshMap[(int)armorInfo.m_ArmorType].SetActive(true); Renderer[] componentsDeepChild = General.GetComponentsDeepChild <Renderer>(item.gameObject); for (int i = 0; i < componentsDeepChild.Length; i++) { componentsDeepChild[i].enabled = false; } BodyInspectionController.Get().OnArmorAttached(slot.m_Limb); }
public override void OnInitialize() { slots.Clear(); buttons.Clear(); active = false; visible = false; for (int k = 0; k < 3; k++) { var newSlot = new ArmorSlot(k); slots.Add(newSlot); Append(newSlot); } }
public ArmorConfig(ArmorPosition[] allowedArmorSlots) { if (allowedArmorSlots == null) { Debug.Log("null armorSlots"); } if (allowedArmorSlots.Length == 0) { Debug.Log("zero armorSlots"); } m_ArmorConfiguration = new ArmorSlot[allowedArmorSlots.Length]; for(int i=0; i < allowedArmorSlots.Length; i++) { m_ArmorConfiguration[i] = new ArmorSlot(allowedArmorSlots[i]); } }
public static ushort GetBestArmorFromStockpile(Stockpile s, ArmorSlot slot, int limit) { var best = default(ushort); foreach (var armor in ArmorLookup.Where(a => a.Value.Slot == slot)) { if (s.Contains(armor.Key) && s.AmountContained(armor.Key) > limit) { if (best == default(ushort) || (!armor.Value.IsMagical && armor.Value.ArmorRating > ArmorLookup[best].ArmorRating)) { best = armor.Key; } } } return(best); }
//Function used to change the armor at the given slot to the new one public void ChangeArmorItemAtSlot(ArmorSlot slot_, Armor armorToChangeTo_) { //Making sure the armor to change to actually matches the slot it's being equipped to if (armorToChangeTo_ != null && armorToChangeTo_.slot != slot_) { return; } //Finding the correct slot to replace switch (slot_) { case ArmorSlot.Head: this.helm = armorToChangeTo_; if (armorToChangeTo_ != null) { armorToChangeTo_.transform.SetParent(this.transform); } break; case ArmorSlot.Body: this.body = armorToChangeTo_; if (armorToChangeTo_ != null) { armorToChangeTo_.transform.SetParent(this.transform); } break; case ArmorSlot.Trinket: this.trinket = armorToChangeTo_; if (armorToChangeTo_ != null) { armorToChangeTo_.transform.SetParent(this.transform); } break; default: break; } //Updating this inventory's weight this.FindArmorStats(); }
private void DrawSlot(Rect rect, ArmorSlot armorSlot) { Text.Anchor = TextAnchor.MiddleCenter; Widgets.Label(new Rect(rect.x, rect.y + 7, 100, 20), armorSlot.Category.GetLabel()); Text.Anchor = TextAnchor.UpperLeft; rect.y += 30; Rect rect2 = new Rect(0, 0, 110, 110); Rect scrollVertRectFact = new Rect(0, 0, 110, armorSlot.Modules.Count * 120); Rect sliderRect = new Rect(rect.x, rect.y, rect.width, rect.height - 40); Widgets.BeginScrollView(sliderRect, ref GetVector(armorSlot.Category), scrollVertRectFact, false); foreach (var slot in armorSlot.Modules) { DrawSlotInfo(rect2, slot, armorSlot); rect2.y += 120; } Widgets.EndScrollView(); }
private void SetImageVisibility(ArmorSlot slot) { switch (slot.ID) { case "Body": IsBodyVisible = true; break; case "Chest": IsChestVisible = true; break; case "Mouth": IsMouthVisible = true; break; case "Eye": IsEyeVisible = true; break; case "Hat": IsHatVisible = true; break; case "Left Arm": IsLeftArmVisible = true; break; case "Right Arm": IsRightArmVisible = true; break; case "Left Leg": IsLeftLegVisible = true; break; case "Right Leg": IsRightLegVisible = true; break; } }
public ColorData GetColorForSlot(ArmorSlot slot) { switch (slot) { case ArmorSlot.Helmet: return(HeadColor); case ArmorSlot.Chestplate: return(ChestColor); case ArmorSlot.Leggings: return(LegColor); case ArmorSlot.Boots: return(BootsColor); default: break; } return(HeadColor); }
public bool getEnchantCompatabilityWithSlot(ArmorSlot slot) { var enchantCompat = EnchantDataExtensions.GetEnchant(Enchant); switch (slot) { case ArmorSlot.Helmet: if (enchantCompat.Head) return true; else return false; case ArmorSlot.Chestplate: if (enchantCompat.Chest) return true; else return false; case ArmorSlot.Leggings: if (enchantCompat.Leggings) return true; else return false; case ArmorSlot.Boots: if (enchantCompat.Boots) return true; else return false; default: return true; } }
public override void _Ready() { headSlot = GetNode <ArmorSlot>(headSlotPath); chestSlot = GetNode <ArmorSlot>(chestSlotPath); legsSlot = GetNode <ArmorSlot>(legsSlotPath); handsSlot = GetNode <ArmorSlot>(handsSlotPath); mainHandSlot = GetNode <WeaponSlot>(mainHandSlotPath); offHandSlot = GetNode <WeaponSlot>(offHandSlotPath); leftRingSlot = GetNode <TrinketSlot>(leftRingSlotPath); necklaceSlot = GetNode <TrinketSlot>(necklaceSlotPath); rightRingSlot = GetNode <TrinketSlot>(rightRingSlotPath); slots = new EquipmentSlot[] { headSlot, chestSlot, legsSlot, handsSlot, mainHandSlot, offHandSlot, leftRingSlot, necklaceSlot, rightRingSlot }; ConnectCallbacks(); }
// Use this for initialization void Start() { Mannequin mannequin = avatarController.character.GetComponent <Mannequin>(); if (mannequin != null) { foreach (Transform child in slotViewParent) { Destroy(child.gameObject); } slotViews = new UISlotView[mannequin.armorSlots.Length]; for (int i = 0; i < slotViews.Length; i++) { ArmorSlot slot = mannequin.armorSlots[i]; int k = i; slotViews[i] = Instantiate(slotViewPrefab); slotViews[i].component = slot.Get(); slotViews[i].slotName = slot.slotName; slotViews[i].defaultLabel = "None"; slotViews[i].GetComponent <UIButton>().onClick.AddListener(() => pickItemForSlot(slot, k)); slotViews[i].transform.SetParent(slotViewParent, false); } for (int i = 0; i < slotViews.Length; i++) { int prev = NeverdawnUtility.RepeatIndex(i - 1, slotViews.Length); int next = NeverdawnUtility.RepeatIndex(i + 1, slotViews.Length); slotViews[i].selectable.neighborBottom = slotViews[next].selectable; slotViews[i].selectable.neighborTop = slotViews[prev].selectable; } } }
public void SetSlot(ArmorSlot slot) { Slot = slot; }
public Clothing(ArmorSlot slot) { _slot = slot; }
private ArmorSlot _slot; //store the slot the armor will be in public Clothing() { _slot = ArmorSlot.Head; }
private ArmorSlot _slot; //store the slot the armor will be in #endregion Fields #region Constructors public Clothing() { _slot = ArmorSlot.Head; }
void OnGUI() { if (itemManager != null) { List <WeaponItem> weaponList = new List <WeaponItem>(); List <ArmorItem> armorList = new List <ArmorItem>(); newItemID = _itemList.Count; for (int i = 0; i < _itemList.Count; i++) { if (_itemList[i].GetType() == typeof(WeaponItem)) { weaponList.Add((WeaponItem)_itemList[i]); } if (_itemList[i].GetType() == typeof(ArmorItem)) { armorList.Add((ArmorItem)_itemList[i]); } } EditorGUILayout.BeginHorizontal(); EditorGUILayout.PrefixLabel("Item Type: "); currentItemToCreate = (ItemToCreate)EditorGUILayout.EnumPopup(currentItemToCreate); EditorGUILayout.EndHorizontal(); EditorGUILayout.LabelField("General Attributes:", EditorStyles.boldLabel); newItemID = EditorGUILayout.IntField("ID (BE CAREFUL): ", newItemID); newItemName = EditorGUILayout.TextField("Name: ", newItemName); newItemDesc = EditorGUILayout.TextField("Description: ", newItemDesc); newItemValue = EditorGUILayout.IntField("Item Value: ", newItemValue); EditorGUILayout.BeginHorizontal(); EditorGUILayout.PrefixLabel("Icon: "); newItemIcon = (Texture2D)EditorGUILayout.ObjectField(newItemIcon, typeof(Texture2D), true); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.PrefixLabel("Rarity: "); newItemRarity = (RarityTypes)EditorGUILayout.EnumPopup(newItemRarity); EditorGUILayout.EndHorizontal(); switch (currentItemToCreate) { case ItemToCreate.Weapon: EditorGUILayout.LabelField("Weapon-Specific Attributes:", EditorStyles.boldLabel); newWeaponMaxDamage = EditorGUILayout.IntField("Max Damage: ", newWeaponMaxDamage); newWeaponMinDamage = EditorGUILayout.IntField("Min Damage: ", newWeaponMinDamage); EditorGUILayout.BeginHorizontal(); EditorGUILayout.PrefixLabel("Damage Type: "); newWeaponDamageType = (DamageType)EditorGUILayout.EnumPopup(newWeaponDamageType); EditorGUILayout.EndHorizontal(); break; case ItemToCreate.Armor: EditorGUILayout.LabelField("Armor-Specific Attributes:", EditorStyles.boldLabel); EditorGUILayout.BeginHorizontal(); EditorGUILayout.PrefixLabel("Armor Slot: "); newArmorSlot = (ArmorSlot)EditorGUILayout.EnumPopup(newArmorSlot); EditorGUILayout.EndHorizontal(); newArmorLvl = EditorGUILayout.IntField("Armor Level: ", newArmorLvl); break; } if (GUILayout.Button("Add New Item")) { switch (currentItemToCreate) { case ItemToCreate.Weapon: WeaponItem newWeapon = (WeaponItem)ScriptableObject.CreateInstance <WeaponItem>(); newWeapon.Name = newItemName; newWeapon.ItemDescription = newItemDesc; newWeapon.ItemID = newItemID; newWeapon.ItemIcon = newItemIcon; newWeapon.Value = newItemValue; newWeapon.Rarity = newItemRarity; newWeapon.MaxDamage = newWeaponMaxDamage; newWeapon.MinDamage = newWeaponMinDamage; newWeapon.TypeOfDamage = newWeaponDamageType; newWeapon.ItemTypeV = (ItemType)currentItemToCreate; _itemList.Add(newWeapon); break; case ItemToCreate.Armor: ArmorItem newArmor = (ArmorItem)ScriptableObject.CreateInstance <ArmorItem>(); newArmor.Name = newItemName; newArmor.ItemDescription = newItemDesc; newArmor.ItemID = newItemID; newArmor.ItemIcon = newItemIcon; newArmor.Value = newItemValue; newArmor.Rarity = newItemRarity; newArmor.ArmorLevel = newArmorLvl; newArmor.Slot = newArmorSlot; newArmor.ItemTypeV = (ItemType)currentItemToCreate; _itemList.Add(newArmor); break; } } EditorGUILayout.Space(); showingLists = EditorGUILayout.Foldout(showingLists, "Item Database"); EditorGUI.indentLevel = 2; // if (showingLists){ // EditorGUILayout.LabelField("Total items: " + _itemList.Count); // EditorGUILayout.LabelField("Total weapons: " + weaponList.Count); // EditorGUILayout.LabelField("Total armor items: " + armorList.Count); // EditorGUILayout.Space(); // // scrollPos = EditorGUILayout.BeginScrollView(scrollPos); // EditorGUI.indentLevel -= 1; // showingWeapons = EditorGUILayout.Foldout(showingWeapons, "Weapons"); // if (showingWeapons){ // EditorGUI.indentLevel += 2; // for (int i = 0; i < weaponList.Count; i++){ // EditorGUILayout.BeginHorizontal(); // EditorGUILayout.LabelField(weaponList[i].Name); // if (GUILayout.Button("-")){ // _itemList.Remove(_itemList[i]); // } // EditorGUILayout.EndHorizontal(); // EditorGUI.indentLevel +=1; // weaponList[i].ItemID = EditorGUILayout.IntField ("ID: ", weaponList[i].ItemID); // weaponList[i].Name = EditorGUILayout.TextField ("Name: ", weaponList[i].Name); // weaponList[i].ItemDescription = EditorGUILayout.TextField ("Description: ", weaponList[i].ItemDescription); // weaponList[i].Value = EditorGUILayout.IntField ("Value: ", weaponList[i].Value); // weaponList[i].MaxDamage = EditorGUILayout.IntField ("Max Damage: ", weaponList[i].MaxDamage); // weaponList[i].MinDamage = EditorGUILayout.IntField ("Min Damage: ", weaponList[i].MinDamage); // EditorGUILayout.BeginHorizontal(); // EditorGUILayout.PrefixLabel("Damage Type: "); // weaponList[i].TypeOfDamage = (DamageType)EditorGUILayout.EnumPopup(weaponList[i].TypeOfDamage); // EditorGUILayout.EndHorizontal(); // EditorGUI.indentLevel -=1; // } // EditorGUI.indentLevel -= 2; // } // showingArmor = EditorGUILayout.Foldout(showingArmor, "Armor Items"); // if (showingArmor){ // EditorGUI.indentLevel += 2; // for (int i = 0; i < armorList.Count; i++){ // EditorGUILayout.BeginHorizontal(); // EditorGUILayout.LabelField(armorList[i].Name); // if (GUILayout.Button("-")){ // _itemList.Remove(_itemList[i]); // } // EditorGUILayout.EndHorizontal(); // EditorGUI.indentLevel +=1; // armorList[i].ItemID = EditorGUILayout.IntField ("ID: ", armorList[i].ItemID); // armorList[i].Name = EditorGUILayout.TextField ("Name: ", armorList[i].Name); // armorList[i].ItemDescription = EditorGUILayout.TextField ("Description: ", armorList[i].ItemDescription); // armorList[i].Value = EditorGUILayout.IntField ("Value: ", armorList[i].Value); // armorList[i].ArmorLevel = EditorGUILayout.IntField("Armor Level: ", armorList[i].ArmorLevel); // EditorGUI.indentLevel -=1; // } // EditorGUI.indentLevel -= 2; // } // EditorGUILayout.EndScrollView(); // } EditorGUI.indentLevel -= 2; showingIDList = EditorGUILayout.Foldout(showingIDList, "ID list"); EditorGUI.indentLevel = 2; if (showingIDList) { for (int i = 0; i < _itemList.Count; i++) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField(_itemList[i].ItemID.ToString() + ":\t" + _itemList[i].Name); if (GUILayout.Button("Edit")) { AssetDatabase.OpenAsset(_itemList[i]); } if (GUILayout.Button("Remove")) { if (EditorUtility.DisplayDialog("Are you sure you want to remove object?", "Cannot be undone", "Remove", "Cancel")) { _itemList.Remove(_itemList[i]); } } EditorGUILayout.EndHorizontal(); } } // if (showingLists = true) EditorGUILayout.EndScrollView(); } }