using System.Collections;using System.Collections.Generic;using UnityEngine;public class AnimationManager : MonoBehaviour { Animator anim; void Start () { anim = GetComponent (); } void Update () { var estaMovendo = Input.GetAxis ("Vertical"); if (estaMovendo != 0) { anim.SetBool ("estaAndando", true); anim.SetBool ("estaParado", false); } else { anim.SetBool ("estaAndando", false); anim.SetBool ("estaParado", true); } if (Input.GetButtonDown ("Fire1")) { anim.SetBool ("estaAtacando", true); anim.SetBool ("estaParado", false); } else { anim.SetBool ("estaAtacando", false); } }}
#pragma strictpublic class AnimationManager extends MonoBehaviour{var anim: Animator;function Start(){anim = gameObject.GetComponent("Animator") as Animator;}function Update () {var estaMovimentando: float = Input.GetAxis("Vertical"); if (estaMovimentando != 0){ anim.SetBool("estaAndando", true); anim.SetBool("estaParado", false);} else { anim.SetBool("estaAndando", false); anim.SetBool("estaParado", true);}if (Input.GetButton("Fire1")){ anim.SetBool("estaAtacando", true); anim.SetBool("estaParado", false);} else { anim.SetBool("estaAtacando", false);} }}
0 comentários:
Postar um comentário