// Use this for initialization void Start() { controller = FindObjectOfType <PlayerController>(); controller2 = FindObjectOfType <PlayerController2>(); swap = FindObjectOfType <WeaponSwap>(); swap2 = FindObjectOfType <WeaponSwap2>(); }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.tag == "Player") { Destroy(gameObject); WeaponSwap2 Replenish = collision.GetComponentInChildren <WeaponSwap2>(); Replenish.holdingChainsaw = true; Debug.Log("Chainsaw has been picked up!"); } }
// Use this for initialization void Start() { hp1 = 100; hp2 = 100; p1PlayerModel.SetActive(true); p1Ragdoll.SetActive(false); p2PlayerModel.SetActive(true); p2Ragdoll.SetActive(false); weapon1 = FindObjectOfType <WeaponSwap>(); weapon2 = FindObjectOfType <WeaponSwap2>(); ammo1 = FindObjectOfType <AmmoManager>(); ammo2 = FindObjectOfType <AmmoManager2>(); grenades = FindObjectOfType <GrenadeAmmo>(); }
// Use this for initialization void Start() { guns = new PlayerShoot[3]; weapon1 = FindObjectOfType <WeaponSwap>(); weapon2 = FindObjectOfType <WeaponSwap2>(); ammo1 = FindObjectOfType <AmmoManager>(); ammo2 = FindObjectOfType <AmmoManager2>(); p1CurrentClip = ammo1.currentClipAmmo; p1CurrentPocket = ammo1.currentPocketAmmo; p2CurrentClip = ammo2.currentClipAmmo; p2CurrentPocket = ammo2.currentPocketAmmo; }