private void Animaciones() { if (m_mc.moveDirection == Vector3.zero) { if (Input.GetAxis("Horizontal1") != 0) { //girando quietos GetComponent<Animation>()["run"].speed = velocidadAnimacionGiro; GetComponent<Animation>().CrossFade("run", 0.2f, PlayMode.StopSameLayer); m_animacionActual = tipoAnimacionRed.GIRO; } else { GetComponent<Animation>().CrossFade("idle"); m_animacionActual = tipoAnimacionRed.IDLE; //animation.CrossFade("idle",0.3f,PlayMode.StopSameLayer); } } else { if (m_mc.moveDirection.z > 0) { //hacia delante GetComponent<Animation>()["run"].speed = velocidadAnimacionDelante; m_animacionActual = tipoAnimacionRed.WALK; } else { if (m_mc.moveDirection.z < 0) { //hacia atras GetComponent<Animation>()["run"].speed = velocidadAnimacionAtras; m_animacionActual = tipoAnimacionRed.MOONWALK; //sendInformacionAnimacion(tipoAnimacionRed.MOONWALK); } } GetComponent<Animation>().CrossFade("run", 0.2f, PlayMode.StopSameLayer); m_animacionActual = tipoAnimacionRed.IDLE; } /* if (Input.GetKey(KeyCode.Mouse0)) { animation.CrossFade("attack", 0.2f); } */ }
public void setAnimacionRed(tipoAnimacionRed t) { animacionRed = t; }
public void setAnimacionRed(string info) { animacionRed = (tipoAnimacionRed)System.Enum.Parse(typeof(tipoAnimacionRed), info); }
// Use this for initialization void Start() { m_mc = GetComponent<MovementController>(); m_nm = GameObject.FindGameObjectWithTag("Network").GetComponent<NetworkManager>(); m_info = GetComponent<Info>(); animacionRed = tipoAnimacionRed.IDLE; }