private void OnTriggerExit2D(Collider2D other) { if (other.gameObject.CompareTag("Machine")) { _nearbyMachine = null; } }
private void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.CompareTag("Machine")) { _nearbyMachine = other.gameObject.GetComponent <BasicInteractable>(); } }
private void Start() { planetRenderer = selectedPlanet.GetComponent <MeshRenderer>(); interactable = selectedPlanet.GetComponent <BasicInteractable>(); interactable.enabled = false; // if planet not set, pickup should be disabled. }