// Once an item is clicked in the menu, decide whether it is a tool, weapon, clothing, or armor to Equip, // or if its consumable to Use.. public void SetSelectedPickupInInv(PickupItemUI pickup) { curSelctedPickupInInv = pickup; ePickupType pickupType = pickup.itemInstanceRef.item.pickupType; if (pickupType == ePickupType.ToolsAndWeapons || pickupType == ePickupType.ClothingAndArmor) { equipText.SetActive(true); canEquipSelectedItem = true; useText.SetActive(false); canUseSelectedItem = false; } else if (pickupType == ePickupType.Consumables) { equipText.SetActive(true); canEquipSelectedItem = true; useText.SetActive(true); canUseSelectedItem = true; } else { equipText.SetActive(false); canEquipSelectedItem = false; useText.SetActive(false); canUseSelectedItem = false; } }
/// <summary> /// /// </summary> /// <param name="pType"></param> /// <param name="pPos"></param> public void SpawnTreasureBox(ePickupType pType, Vector3 pPos) { GameObject newGO = GameObject.Instantiate(this.PrefabTreasureBox, pPos, Quaternion.identity); newGO.GetComponent <TreasureBox>().Type = pType; newGO.transform.position = pPos; }
public void Initialize(ePickupType type, Vector2 location) { IsDisposed = false; PickupType = type; Location = location; MaxChange = Maths.RandomNr(50, 250); switch (PickupType) { case ePickupType.HP: Texture = Textures[0]; break; case ePickupType.Boom1: Texture = Textures[1]; break; case ePickupType.Aim: Texture = Textures[2]; break; case ePickupType.Missile: Texture = Textures[3]; break; case ePickupType.Speed: Texture = Textures[4]; break; case ePickupType.Shield: Texture = Textures[5]; break; case ePickupType.DualMissile: Texture = Textures[6]; break; case ePickupType.ShieldRegen: Texture = Textures[7]; break; default: throw new CaseStatementMissingException(); } }
public void AddPickup(ePickupType type, Vector2 location) { PickupPool[0].Initialize(type, location); Pickups.Add(PickupPool[0]); PickupPool.RemoveAt(0); }