コード例 #1
0
ファイル: ScoreItem.cs プロジェクト: KinGslaYer-9/AvoidSkills
    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);
    }
コード例 #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);
        }
    }
コード例 #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);
        }
    }