private void OnTriggerEnter(Collider other) { if (other.gameObject.GetComponent <S_MachineBase>() != null) { MachineFound = other.gameObject.GetComponent <S_MachineBase>(); } }
private void OnTriggerExit(Collider other) { if (MachineFound != null) { if (other.gameObject.GetComponent <S_MachineBase>() == MachineFound) { Interact(false); MachineFound.Interactable = false; MachineFound = null; } } }
public virtual void Start() { if (GameObject.Find("_GameController") != null) { ref_GameController = GameObject.Find("_GameController").GetComponent <S_GameController>(); } else { Debug.Log("No Game controller!"); } if (ref_GameController.CharacterController.Interactor.MachineFound != null) { ref_Machine = ref_GameController.CharacterController.Interactor.MachineFound; } }