//Initialize the jump according to its type protected void InitJump() { if (m_targetCube.transform.position.y > m_currentCube.transform.position.y) { m_jumpType = "JumpingUp"; m_jumpPathType = 0; } else if (m_targetCube.transform.position.y < m_currentCube.transform.position.y) { m_jumpType = "JumpingDown"; m_jumpPathType = 1; } else { m_jumpType = "JumpingForward"; m_jumpPathType = 2; } m_animator.SetBool("Is" + m_jumpType, true); m_isJumping = true; m_characterLogic.Jump(m_targetCube.GetComponent <CubeController>().M_CubeLogic); }