/*****************************************/ // Use this for initialization void Start() { agent = gameObject.GetComponent<PerceptionInterface>(); hub = GameObject.FindWithTag("Hub").GetComponent<Hub>(); _firefighters = new List<GameObject>(); gameSpeed = hub.gameSpeed; StartCoroutine(test(2f)); }
void OnTriggerEnter(Collider other) { if (other.tag == "FireFighter" && !beingTakenCareOf) { if (other.GetComponent<PerceptionInterface>().fireSensor(transform.parent.gameObject)) { assignedAgent = other.GetComponent<PerceptionInterface>(); beingTakenCareOf = true; } } else if (other.tag == "Builder" && !beingTakenCareOf) { other.GetComponent<Builder>().fireSensor(transform.parent.gameObject); } }
// Use this for initialization void Start () { scrpt = transform.parent.GetComponent<PerceptionInterface>(); }
void OnTriggerEnter(Collider other) { if (scrpt == null) scrpt = transform.parent.GetComponent<PerceptionInterface>(); scrpt.OnTriggerEnter(other); }