Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma strict
- internal var animator : Animator;
- var abaixado : float;
- function Start () {
- animator = GetComponent(Animator);
- }
- function Update () {
- if (Input.GetKey("w"))
- {
- animator.SetFloat ("Speed",2);
- }
- else
- {
- animator.SetFloat ("Speed",0);
- }
- if (Input.GetKey("w")&& Input.GetKey(KeyCode.LeftShift))
- {
- animator.SetFloat ("Speed",1);
- }
- if (Input.GetKey("c"))
- {
- abaixado = 1;
- }
- if (abaixado == 1)
- {
- if (Input.GetKey("v"))
- {
- abaixado = 0;
- }
- }
- if (abaixado == 1)
- {
- animator.SetFloat ("abaixar",0.6);
- }
- else
- {
- animator.SetFloat ("abaixar",0.4);
- }
- if (abaixado == 1)
- {
- if (Input.GetKey("w"))
- {
- animator.SetFloat ("abaixar",0.7);
- }
- }
- else
- {
- animator.SetFloat ("abaixar",0.4);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement