Example #1
0
    // Start is called before the first frame update

    void OnTriggerEnter(Collider other)
    {
        if (other.GetComponent <Reactive_target_player>())
        {
            Reactive_target_player RTP = other.GetComponent <Reactive_target_player>();
            switch (NumberItem)
            {
            case 1:
                Debug.Log("Heal Bonus");
                RTP.Heal();
                break;

            case 2:
                Debug.Log("Add Life Bonus");
                RTP.AddLife();
                break;

            case 3:
                Debug.Log("Merge Bonus");
                break;

            case 4:
                Debug.Log("WhitePower Bonus");
                break;
            }
            Destroy(this.gameObject);
        }
    }