public void Use(GameObject target, out IItem.ItemType type) { type = IItem.ItemType.Score; GameManager.Instance.AddScore(Random.Range(10, 50)); ObjectPoolingManager.Instance.PushToPool(poolItemName, gameObject); }
public void Use(GameObject target, out IItem.ItemType type) { type = IItem.ItemType.Shield; var playerHealth = target.GetComponent <PlayerHealth>(); if (playerHealth != null) { ObjectPoolingManager.Instance.PushToPool(poolItemName, gameObject); } }
public void Use(GameObject target, out IItem.ItemType type) { type = IItem.ItemType.Health; var playerHealth = target.GetComponent <PlayerHealth>(); if (playerHealth != null) { playerHealth.RestoreHealth(Random.Range(10, 50)); ObjectPoolingManager.Instance.PushToPool(poolItemName, gameObject); } }