/Scripts/displayCutScene.js

http://acid-and-base.googlecode.com/ · JavaScript · 65 lines · 63 code · 2 blank · 0 comment · 5 complexity · b0d44a63c12d8b69d6877a55be6f7955 MD5 · raw file

  1. var sceneNum = -1;
  2. var showCutScene = false;
  3. var scene1 : Texture;
  4. var scene2 : Texture;
  5. var scene3 : Texture;
  6. var scene4 : Texture;
  7. var scene5 : Texture;
  8. var scene6 : Texture;
  9. var scene7 : Texture;
  10. var scene8 : Texture;
  11. var scene9 : Texture;
  12. function Update ()
  13. {
  14. if (Input.GetKeyDown(KeyCode.Return) && showCutScene)
  15. {
  16. if (sceneNum > 0 && sceneNum < 3)
  17. {
  18. sceneNum++;
  19. }
  20. else
  21. {
  22. showCutScene = false;
  23. GameObject.Find("Movement").GetComponent("Tutorial").moveshow = true;
  24. }
  25. }
  26. }
  27. function OnGUI()
  28. {
  29. if (showCutScene)
  30. {
  31. switch(sceneNum)
  32. {
  33. case 1:
  34. GUI.Box(Rect(0,0,Screen.width, Screen.height), scene1);
  35. break;
  36. case 2:
  37. GUI.Box(Rect(0,0,Screen.width, Screen.height), scene2);
  38. break;
  39. case 3:
  40. GUI.Box(Rect(0,0,Screen.width, Screen.height), scene3);
  41. break;
  42. case 4:
  43. GUI.Box(Rect(0,0,Screen.width, Screen.height), scene4);
  44. break;
  45. case 5:
  46. GUI.Box(Rect(0,0,Screen.width, Screen.height), scene5);
  47. break;
  48. case 6:
  49. GUI.Box(Rect(0,0,Screen.width, Screen.height), scene6);
  50. break;
  51. case 7:
  52. GUI.Box(Rect(0,0,Screen.width, Screen.height), scene7);
  53. break;
  54. case 8:
  55. GUI.Box(Rect(0,0,Screen.width, Screen.height), scene8);
  56. break;
  57. case 9:
  58. GUI.Box(Rect(0,0,Screen.width, Screen.height), scene9);
  59. break;
  60. default: break;
  61. }
  62. }
  63. }