public void CancelInteraction() { if (currentInteractionGameObj) { currentInteractionGameObj.StopInteraction(); } interactionInProgress = false; currentInteractionGameObj = null; //print("INTERACTION CANCELLED"); }
void StartInteraction() { GameObject newInteractiveGameObject = FindClosestObjectWithTag("interactiveEnvironment", needsToFaceObject); if (Vector3.Distance(transform.position, newInteractiveGameObject.transform.position) < minimumDistance) { interactionInProgress = true; currentInteractionGameObj = newInteractiveGameObject.GetComponent <InteractiveEnvironmentObj>(); //print("INTERACTION STARTED"); } }
void CompleteInteraction() { if (currentInteractionGameObj) { currentInteractionGameObj.StopInteraction(); } interactionInProgress = false; currentInteractionGameObj = null; GameManager.Instance.IncreaseForestHealth(1); //print("INTERACTION COMPLETE!"); }