// Update is called once per frame void Update() { if (Input.GetButton("Horizontal")) { m_fsFoxState = FoxStates.Running; Debug.Log("Key Press"); } else { if (m_bStanding) { m_fsFoxState = FoxStates.Standing; } else { m_fsFoxState = FoxStates.Crawling; } } if (Input.GetButtonDown("Jump")) { if (m_bStanding) { m_fsFoxState = FoxStates.Jumping; } } else { if (m_bLanded) { m_fsFoxState = FoxStates.Standing; } } if (Input.GetButtonDown("Stance")) { if (m_bStanding) { m_fsFoxState = FoxStates.Crawling; } else { m_fsFoxState = FoxStates.Standing; } } }
// Use this for initialization void Start() { m_anFox = GetComponent <Animator>(); m_fsFoxState = FoxStates.Standing; StartCoroutine(manageAnimator()); }