public void SetMoveOpacity(float coefMove1, float coefMove2) { m_backScript.SetOpacity(Constants.MinOpacity); if (m_playerScript.m_state == PlayerScript.State.Left) { if (coefMove2 == 0f) { m_rightScript.SetOpacity(1f); //SideBackRun m_leftScript.SetOpacity(Mathf.Lerp(1f, Constants.MinOpacity, coefMove1)); //SideFrontRun } else { m_leftScript.SetOpacity(1f); //SideFrontRun m_rightScript.SetOpacity(Mathf.Lerp(Constants.MinOpacity, 1f, coefMove2)); //SideBackRun } } else if (m_playerScript.m_state == PlayerScript.State.Right) { if (coefMove2 == 0f) { m_leftScript.SetOpacity(1f); //SideBackRun m_rightScript.SetOpacity(Mathf.Lerp(1f, Constants.MinOpacity, coefMove1)); //SideFrontRun } else { m_rightScript.SetOpacity(1f); //SideFrontRun m_leftScript.SetOpacity(Mathf.Lerp(Constants.MinOpacity, 1f, coefMove2)); //SideBackRun } } }
public void SetJumpOpacity(float coefJump) { m_frontScript.SetOpacity(Mathf.Lerp(1f, Constants.MinOpacity, coefJump)); m_backScript.SetOpacity(Mathf.Lerp(Constants.MinOpacity, 1f, coefJump)); if (coefJump == 1) { m_frontScript.SetOpacity(1f); m_backScript.SetOpacity(Constants.MinOpacity); } }