animation_blend.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. var BSvar = 0.5;
  2. private var Tok = 0.0;
  3. function Update ()
  4. {
  5. if (Input.GetKeyDown (KeyCode.Keypad0) && Time.time > Tok){
  6. Tok = Time.time + BSvar;
  7. GetComponent.<Animation>().CrossFade("Santa_backwalk", BSvar);
  8. }
  9. if (Input.GetKeyDown (KeyCode.Keypad9)&& Time.time > Tok){
  10. Tok = Time.time+ BSvar;
  11. GetComponent.<Animation>().CrossFade ("Santa_use", BSvar);
  12. }
  13. if (Input.GetKeyDown (KeyCode.Keypad1)&& Time.time > Tok){
  14. Tok = Time.time+ BSvar;
  15. GetComponent.<Animation>().CrossFade ("Santa_walk", BSvar);
  16. }
  17. if (Input.GetKeyDown (KeyCode.Keypad2)&& Time.time > Tok){
  18. Tok = Time.time+ BSvar;
  19. GetComponent.<Animation>().CrossFade ("Santa_Lsidewalk", BSvar);
  20. }
  21. if (Input.GetKeyDown (KeyCode.Keypad3)&& Time.time > Tok){
  22. Tok = Time.time+ BSvar;
  23. GetComponent.<Animation>().CrossFade ("Santa_Rsidewalk", BSvar);
  24. }
  25. if (Input.GetKeyDown (KeyCode.Keypad4)&& Time.time > Tok){
  26. Tok = Time.time+ BSvar;
  27. GetComponent.<Animation>().CrossFade ("Santa_sneak", BSvar);
  28. }
  29. if (Input.GetKeyDown (KeyCode.Keypad5)&& Time.time > Tok){
  30. Tok = Time.time+ BSvar;
  31. GetComponent.<Animation>().CrossFade ("Santa_run", BSvar);
  32. }
  33. if (Input.GetKeyDown (KeyCode.Keypad6)&& Time.time > Tok){
  34. Tok = Time.time+ BSvar;
  35. GetComponent.<Animation>().CrossFade ("Santa_jump", BSvar);
  36. }
  37. if (Input.GetKeyDown (KeyCode.Keypad7)&& Time.time > Tok){
  38. Tok = Time.time+ BSvar;
  39. GetComponent.<Animation>().CrossFade ("Santa_hoho", BSvar);
  40. }
  41. if (Input.GetKeyDown (KeyCode.Keypad8)&& Time.time > Tok){
  42. Tok = Time.time+ BSvar;
  43. GetComponent.<Animation>().CrossFade ("Santa_give", BSvar);
  44. }
  45. if (Input.GetKeyDown (KeyCode.S)&& Time.time > Tok){
  46. Tok = Time.time+ BSvar;
  47. GetComponent.<Animation>().CrossFade ("Santa_standstill", BSvar);
  48. }
  49. if (Input.GetKeyDown (KeyCode.I)&& Time.time > Tok){
  50. Tok = Time.time+ BSvar;
  51. GetComponent.<Animation>().CrossFade("Santa_idle", BSvar);
  52. }
  53. if (Input.GetKeyDown (KeyCode.T)&& Time.time > Tok){
  54. Tok = Time.time+ BSvar;
  55. GetComponent.<Animation>().CrossFade("Santa_Tpose", BSvar);
  56. }
  57. }