/* Sets isDying and the trigger "makeBow" of the Animator attached to the same gameObject as this script, * if the given string matches "symptom". At a match this Victim instance is removed from InteractableManager. */ public void Rescue(string curedSymptom) { if (curedSymptom == symptom) { print("Succesfully rescued victim!"); string[] msg = { RESCUE_SUCCESS }; infoBox.DisplayInfo(msg); victimAnimCon.SetTrigger("makeBow"); bowAnimStart = Time.time; isDying = keepMeEnabled = true; InteractableManager intManager = GameObject.Find("Interactables").GetComponent <InteractableManager>(); intManager.RemoveInteractable(this); intManager.ResetInRangeInteractable(); } else { print("The chant did not cure this person!"); // victimAnimCon.SetTrigger("makeBow"); // FOR DEBUG! //bowAnimStart = Time.time; //isDying = keepMeEnabled = true; string[] msg = { RESCUE_FAIL }; infoBox.DisplayInfo(msg); /*InteractableManager intManager = GameObject.Find("Interactables").GetComponent<InteractableManager>(); // FOR DEBUG! * intManager.RemoveInteractable(this); * intManager.ResetInRangeInteractable();*/ } }
public override void Interact() { //print("Picking up scroll with content " + info.content + " " + info.color); InteractableManager intManager = GameObject.Find("Interactables").GetComponent <InteractableManager>(); // So this scroll is not updated in InteractableManager intManager.RemoveInteractable(this); intManager.ResetInRangeInteractable(); Player player = GameObject.Find("Player").GetComponent <Player>(); player.inventory.AddScroll(this.info); Destroy(this.gameObject); }