Example #1
0
    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);
    }
Example #2
0
    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);
        }
    }
Example #3
0
    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);
        }
    }