コード例 #1
0
ファイル: Pickup.cs プロジェクト: bab178/GameDevFall2016
        void OnTriggerEnter2D(Collider2D other)
        {
            if (other.gameObject.tag == "Player")
            {
                PlayerController playerController = other.gameObject.GetComponent <PlayerController>();

                if (pickupType == PickupType.Health)
                {
                    playerController.HealPlayer(Magnitude);
                    Destroy(gameObject);
                }
                else if (pickupType == PickupType.Gold)
                {
                }
                else if (pickupType == PickupType.Mana)
                {
                }
            }
        }