コード例 #1
0
        void OnTriggerEnter(Collider other)
        {
            if (other.tag == "Player")
            {
                //Debug.Log("I'am a AmmoBox type " + ammoType + " and i was touched by " + marineType);

                PlayerAmmo playerInv = other.gameObject.GetComponent <PlayerAmmo>();

                if (ammoType == AmmoType.AmmoType1 && marineType == MarinesType.MajCarter)
                {
                    playerInv.PickUpAmmo(ammoType, amount * 20);                                                                        // Flamethrower
                }
                else
                {
                    playerInv.PickUpAmmo(ammoType, amount);
                }
                amount = 0;
                Depop();
            }
        }