Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function OnTriggerStay (other: Collider) {
- if(other.gameObject.tag == "Player" && encumblink.Encumbrance <= 5)
- {
- npctrigger = true;
- }
- if(other.gameObject.tag == "Player" && encumblink.Encumbrance > 5)
- {
- npctrigger = false;
- no_coop_button = true;
- }
- }
- function OnTriggerExit ()
- {
- npctrigger = false;
- }
- function OnGUI()
- {
- if (no_coop_button)
- {
- GUI.BeginGroup (Rect (Screen.width / 2 - 50, Screen.height / 2 - 50, 100, 100));
- GUI.Box (Rect(0, 0, 100, 100), "You are \n a thief");
- GUI.EndGroup ();
- }
- if (npctrigger)
- {
- GUI.BeginGroup (Rect (Screen.width / 2 - 50, Screen.height / 2 - 50, 100, 100));
- }
- if (yesbutton)
- {
- GUI.Box (Rect(0, 0, 100, 100), "Enter \n treasure \n chest");
- Destroy(this, 5.0f);
- }
- else if (nobutton)
- {
- GUI.Box (Rect(0, 0, 100, 100), "You \n cannot \n enter");
- Destroy(this, 5.0f);
- }
- else
- {
- GUI.Box (Rect(0, 0, 100, 100), "Give inventory?");
- if (GUI.Button (Rect(25, 25, 50, 30), "Yes"))
- {
- yesbutton = true;
- Debug.Log("True");
- }
- if (GUI.Button (Rect(25, 65, 50, 30), "No"))
- {
- nobutton = true;
- Debug.Log("No");
- }
- }
- GUI.EndGroup ();
- }
Add Comment
Please, Sign In to add comment