Hi all,
Need some help here.
I am trying to make a system by which player has to talk to a person before talking to the other one. I figured I have to disable the script and enable it when needed. But it still somehow works even after disabling. Here is the script of the second person -
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class JeffTalk : MonoBehaviour {
public bool textBoxOnCheck = false;
public GameObject messageBox;
public GameObject textBox;
public string messageText;
public GameObject questBox;
public GameObject questText;
public string questName;
public GameObject ringCount;
public string ringNumbers;
public string talkProgress;
public GameObject jeff;
void OnMouseDown () {
if (jeff.GetComponent<JeffTalk> ().enabled = true) {
if ((textBoxOnCheck == false) && (talkProgress == "notDone")) {
questText.GetComponent<Text> ().text = questName;
textBoxOnCheck = true;
messageBox.SetActive (true);
textBox.GetComponent<Text> ().text = messageText;
messageText = "Our village is famous for the ancestral Albedo Rings which was created by god. But few days ago, a lightning strike scattered them all accross the land. Can you please retrieve them?";
ringCount.GetComponent<Text> ().text = ringNumbers;
questText.SetActive (true);
} else {
textBoxOnCheck = false;
messageBox.SetActive (false);
ringCount.SetActive (true);
questName = "Active Quest : Retrieve the Albedo Rings";
talkProgress = "Done";
}
} else {
}
}
void Update () {
}
}