Advertisement
irishstorm

FrameCounter_Message

Oct 4th, 2012
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. //FrameCounter_Message.js
  2. //Date : 04/10/2012
  3. //Time : 10:18
  4. //Tutor : Barry Dempsey
  5. //Author : Christopher Cullen
  6.  
  7. //delcares the variable frameCounter as a int and the value of 0.
  8. public var frameCounter : int = 0;
  9.  
  10. //delcares the variable messageToUser as a String and the value of "Rawr!!!".
  11. public var messageToUser : String = "Rawr!!!";
  12.  
  13. function Start ()
  14. {
  15.  
  16. }
  17.  
  18. function Update ()
  19. {
  20. // Stores Time.frameCount in the varible frameCounter.
  21. frameCounter = Time.frameCount;
  22.  
  23. // If frameCounter is less or equal to the value 96 then display the message.
  24. if(frameCounter <= 96)
  25. {
  26. //Hooks in the DisplayMessageToUser function as methood call.
  27. DisplayMessageToUser(messageToUser);
  28. }
  29.  
  30. // If frameCounter is Greater or equal to the value of 96 then display the other message.
  31. if(frameCounter >= 96)
  32. {
  33. // Gives a warning that the value has been exceeded!.
  34. Debug.LogWarning("Frame Counter has exceeded its limit of 96!");
  35. }
  36. }
  37.  
  38. function DisplayMessageToUser( messageToUser : String )
  39. {
  40. //Logs the message in the console.
  41. Debug.Log(messageToUser);
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement