void OnTriggerExit(Collider other) { if (other.tag == "Player") { Debug.Log("Exited"); active = false; foreach (GameObject btn in actions) { btn.SetActive(false); } TalkImage.SetActive(false); TalkImageActive = false; TalkText.SetActive(false); } }
public void Talk() { if (TalkImageActive) { TalkImage.SetActive(false); TalkImageActive = false; TalkText.SetActive(false); } else { RescueLeaderAnim.SetTrigger("LeaderTalkTrigger"); TalkImage.SetActive(true); TalkImageActive = true; TalkText.SetActive(true); } }
void Start() { CommunicationLayer = HUD.transform.Find("CommunicationLayer").gameObject; TalkBtn = CommunicationLayer.transform.Find("CommTalkBtn").gameObject; FinishBtn = CommunicationLayer.transform.Find("CommFinishBtn").gameObject; TalkImage = HUD.transform.Find("TalkImage").gameObject; actions = new List <GameObject>() { FinishBtn, TalkBtn }; active = false; foreach (GameObject btn in actions) { btn.SetActive(false); } TalkText = TalkImage.transform.Find("TalkText").gameObject; Text txtField = TalkText.GetComponent <Text>(); txtField.text = "Hi! There has been a car accident. Several pepople are serverely injured. Please hurry! And also, watch out for the gas leak... "; TalkText.SetActive(false); TalkImage.SetActive(false); RescueLeaderAnim = transform.parent.gameObject.GetComponent <Animator>(); }
public void CloseTalk() { TalkImage.SetActive(false); TalkImageActive = false; TalkText.SetActive(false); }