Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //FrameCounter_Message.js
- //Date : 04/10/2012
- //Time : 10:18
- //Tutor : Barry Dempsey
- //Author : Christopher Cullen
- //delcares the variable frameCounter as a int and the value of 0.
- public var frameCounter : int = 0;
- //delcares the variable messageToUser as a String and the value of "Rawr!!!".
- public var messageToUser : String = "Rawr!!!";
- function Start ()
- {
- }
- function Update ()
- {
- // Stores Time.frameCount in the varible frameCounter.
- frameCounter = Time.frameCount;
- // If frameCounter is less or equal to the value 96 then display the message.
- if(frameCounter <= 96)
- {
- //Hooks in the DisplayMessageToUser function as methood call.
- DisplayMessageToUser(messageToUser);
- }
- // If frameCounter is Greater or equal to the value of 96 then display the other message.
- if(frameCounter >= 96)
- {
- // Gives a warning that the value has been exceeded!.
- Debug.LogWarning("Frame Counter has exceeded its limit of 96!");
- }
- }
- function DisplayMessageToUser( messageToUser : String )
- {
- //Logs the message in the console.
- Debug.Log(messageToUser);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement