private void OnTriggerExit(Collider other)
    {
        WeaponPickedUpOrLeft();

        //player leaves GUN-inator premise
        if (the_GUNINATOR != null)
        {
            the_GUNINATOR = null;
            press_E.SetActive(false);
        }
        //player enter ATM premise
        if (the_ATM != null)
        {
            the_ATM = null;
            press_E.SetActive(false);
        }
    }
 //player able to pick up weapon
 private void OnTriggerEnter(Collider other)
 {
     if (other.GetComponent <BaseGun>() != null)
     {
         WeaponDetected(other.GetComponent <BaseGun>());
     }
     //player enter GUN-inator premise
     if (other.GetComponent <GUNINATORGunCreation>() != null)
     {
         the_GUNINATOR = other.GetComponent <GUNINATORGunCreation>();
         press_E.SetActive(true);
     }
     //player enter ATM premise
     if (other.GetComponent <ATM>() != null)
     {
         the_ATM = other.GetComponent <ATM>();
         press_E.SetActive(true);
     }
 }
Ejemplo n.º 3
0
 //public GameObject testObject;
 private void Start()
 {
     the_GUNINATORGunCreation = GetComponent <GUNINATORGunCreation>();
 }