public Customer(GameObject customerManager, bool antiMask, bool masked, GameObject customerObject, Transform[] nodeTasks) { manager = customerManager; shouldDespawn = false; isAntiMasker = antiMask; customer = customerObject; agent = customerObject.GetComponent <NavMeshAgent>(); tasks = nodeTasks; maskScript = customerObject.GetComponent <WearingMask>(); maskScript.masked = masked; }
private void OnCollisionEnter(Collision other) { cCollider = other.collider; cMask = cCollider.GetComponent <WearingMask>(); Debug.Log(cMask); if (cMask) { cMask.Mask(); Destroy(gameObject, .5f); } }