private void OnTriggerExit(Collider other) { if (other.tag == "TaskLocation") { TaskLocation location = other.GetComponent <TaskLocation>(); if (location == null) { return; } if (_currentLocation == location) { _currentLocation = null; } } else if (other.tag == "Pickup") { var pickup = other.GetComponent <Pickup>(); if (_currentPickup == pickup) { _currentPickup = null; } } else if (other.tag == "PickupBox") { _consumeBox = null; } }
private void OnTriggerEnter(Collider other) { if (other.tag == "TaskLocation") { TaskLocation location = other.GetComponent <TaskLocation>(); if (location != null) { _currentLocation = location; } } else if (other.tag == "Pickup") { _currentPickup = other.GetComponent <Pickup>(); } else if (other.tag == "PickupBox") { _consumeBox = other.GetComponent <ConsumeBox>(); } }