void CheckDirection()
    {
        Vector3 mScale = this.transform.localScale;

        if (aim.GetFacingRight())
        {
            transform.localScale = new Vector3(Mathf.Abs(mScale.x), mScale.y, mScale.z);
        }
        else
        {
            if (Mathf.Sign(mScale.x) == 1)
            {
                transform.localScale = new Vector3(-mScale.x, mScale.y, mScale.z);
            }
            else if (Mathf.Sign(mScale.x) == -1)
            {
                transform.localScale = new Vector3(mScale.x, mScale.y, mScale.z);
            }
        }
    }
Beispiel #2
0
    private void CheckDirection()
    {
        Vector3 pScale = this.transform.localScale;

        if (aim.GetFacingRight())
        {
            transform.localScale = new Vector3(Mathf.Abs(pScale.x), pScale.y, pScale.z);
        }
        else
        {
            if (Mathf.Sign(pScale.x) == 1)
            {
                transform.localScale = new Vector3(-pScale.x, pScale.y, pScale.z);
            }
            else if (Mathf.Sign(pScale.x) == -1)
            {
                transform.localScale = new Vector3(pScale.x, pScale.y, pScale.z);
            }
        }
    }