Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class showMessage : MonoBehaviour {
  5. GameObject player;
  6. private bool startLap;
  7.  
  8. void OnTriggerEnter ( Collider other ){
  9. if(other.tag == "Player") {
  10. bool = true;
  11. }
  12. }
  13.  
  14. void OnGUI (){
  15. if(bool == true) {
  16. if(GUI.Button ( new Rect(100, 100, 500, 40), "Help! I lost my car. Find it through this maze for me?")) {
  17. Debug.Log("Door Works!");
  18. bool = false;
  19.  
  20. }
  21. }
  22.  
  23.  
  24. }
  25. }
  26.  
  27. using UnityEngine;
  28.  
  29. public class showMessage : MonoBehaviour
  30. {
  31. private bool startLap;
  32.  
  33. void OnTriggerEnter(Collider other)
  34. {
  35. if (other.tag == "Player")
  36. {
  37. startLap = true;
  38. }
  39. }
  40.  
  41. void OnGUI()
  42. {
  43. if (startLap)
  44. {
  45. if (GUI.Button(new Rect(100, 100, 500, 40), "Help! I lost my car. Find it through this maze for me?"))
  46. {
  47. Debug.Log("Door Works!");
  48. startLap = false;
  49. }
  50. }
  51. }
  52. }
  53.  
  54. private bool startLap;
  55. private bool foo;
  56. private bool bar;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement