Advertisement
Guest User

Untitled

a guest
Oct 20th, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #pragma strict
  2. internal var animator : Animator;
  3. var abaixado : float;
  4.  
  5.  
  6. function Start () {
  7.  
  8. animator = GetComponent(Animator);
  9.  
  10. }
  11.  
  12. function Update () {
  13.  
  14.  
  15. if (Input.GetKey("w"))
  16. {
  17. animator.SetFloat ("Speed",2);
  18. }
  19.  
  20. else
  21. {
  22. animator.SetFloat ("Speed",0);
  23. }
  24.  
  25.  
  26.  
  27.  
  28. if (Input.GetKey("w")&& Input.GetKey(KeyCode.LeftShift))
  29. {
  30. animator.SetFloat ("Speed",1);
  31. }
  32.  
  33. if (Input.GetKey("c"))
  34. {
  35. abaixado = 1;
  36. }
  37.  
  38. if (abaixado == 1)
  39. {
  40. if (Input.GetKey("v"))
  41. {
  42. abaixado = 0;
  43. }
  44. }
  45. if (abaixado == 1)
  46. {
  47. animator.SetFloat ("abaixar",0.6);
  48. }
  49.  
  50. else
  51. {
  52. animator.SetFloat ("abaixar",0.4);
  53. }
  54.  
  55. if (abaixado == 1)
  56. {
  57. if (Input.GetKey("w"))
  58. {
  59. animator.SetFloat ("abaixar",0.7);
  60. }
  61. }
  62.  
  63. else
  64. {
  65. animator.SetFloat ("abaixar",0.4);
  66. }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement