private void OnTriggerStay(Collider other) { canPressButton = true; collidername = other.name; if (other.CompareTag("Customer")) { if (other.name == "customer_1") { canSendCombination = true; currentCustomer = 1; } else if (other.name == "customer_2") { canSendCombination = true; currentCustomer = 2; } else if (other.name == "customer_3") { canSendCombination = true; currentCustomer = 3; } return; } else { canSendCombination = false; } if ((other.name == "chopper_1" || other.name == "chopper_2") && lastChopper == null) { lastChopper = other.GetComponent <ChopperScript>(); if (other.name == "chopper_1") { lastChopperNumber = 1; } else { lastChopperNumber = 2; } } }
private void OnTriggerExit(Collider other) { canPressButton = false; lastChopper = null; canSendCombination = false; }