void OnTriggerEnter(Collider collider) { if (collider.tag == "Alien") { GetComponentInChildren <SphereCollider>().enabled = false; if (armoryInventory.weapons > 0) { alertState = Random.Range(1, 3); } else { alertState = 1; } if (alertState == 1) { Debug.Log("Alien detected! Crewman is panicking!"); } if (alertState == 2) { Debug.Log("Alien detected! Crewman is encouraged!"); this.transform.Find("Encourage").gameObject.SetActive(true); } GoapAgent ga = this.GetComponent <GoapAgent>(); ga.AbortAndReturnToIdleState(); } }
void OnTriggerEnter(Collider collider) { if (collider.tag == "Alien") { alienTarget = collider.gameObject.transform.parent.gameObject; alertState = 1; Debug.Log("Alien detected! FIRE!"); GoapAgent ga = this.GetComponent <GoapAgent>(); ga.AbortAndReturnToIdleState(); } }
void OnTriggerEnter(Collider collider) { if (collider.tag == "Alien") { GetComponentInChildren <SphereCollider>().enabled = false; alertState = 1; Debug.Log("Alien detected! Crewman is panicking!"); GoapAgent ga = this.GetComponent <GoapAgent>(); ga.AbortAndReturnToIdleState(); } }