Advertisement
LittleAngel

Declaring Vars...

Apr 17th, 2012
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. // Which is "better"
  2.  
  3. // This:
  4. private var moveHorizontal : float;
  5. private var moveVertical : float;
  6.  
  7. function Update () {
  8. moveHorizontal = Input.GetAxis ("Horizontal");
  9. moveVertical = Input.GetAxis ("Vertical");
  10. movement = Vector3 (moveHorizontal, 0.0f, moveVertical);
  11. transform.Translate (movement, Space.World);
  12. }
  13. // Or This:
  14.  
  15. function Update () {
  16. var moveHorizontal = Input.GetAxis ("Horizontal");
  17. var moveVertical = Input.GetAxis ("Vertical");
  18. movement = Vector3 (moveHorizontal, 0.0f, moveVertical);
  19. transform.Translate (movement, Space.World);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement