Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private var isClicked : boolean = false;//This variable will change when an NPC is clicked
- public var responseString : String = "NO ENTRY!"; //This is the responseString
- //It will be updated by switch statements for each button (or question)
- function OnGUI()
- {
- if(!isClicked) return;
- GUI.Box (Rect (Screen.width / 2 - 360,300,700,400), "Guard");
- responseString = GUI.TextArea (Rect (Screen.width / 2 - 200, Screen.height / 2 -50, 400, 50), responseString, 150);
- if (GUI.Button(Rect(Screen.width / 2 - 100, Screen.height / 2 + 50, 180, 40), "Can I go in?")) {
- responseString = "I said no!";
- }
- if (GUI.Button(Rect(Screen.width / 2 - 100, Screen.height / 2 + 100, 180, 40), "I need that necklace!")) {
- responseString = "What necklace?";
- }
- if (GUI.Button(Rect(Screen.width / 2 - 100, Screen.height / 2 + 150, 180, 40), "So, United won the title...")) {
- responseString = "Arsenal are bottlers";
- }
- if (GUI.Button(Rect(Screen.width / 2 - 100, Screen.height / 2 + 200, 180, 40), "Seeya")) {
- responseString = "NO ENTRY";
- isClicked = false;
- }
- }
- function OnMouseUp()
- {
- isClicked = true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement