示例#1
0
    private bool IsTargetToMyLeft()
    {
        bool isLeft;

        if (defaultOrientation)
        {
            isLeft = (target.transform.position.x < gameObject.transform.position.x && OrientationHelper.FacingUp(transform)) ||
                     (target.transform.position.x > gameObject.transform.position.x && OrientationHelper.FacingDown(transform));
        }
        else
        {
            isLeft = (target.transform.position.y > gameObject.transform.position.y && OrientationHelper.FacingRight(transform)) ||
                     (target.transform.position.y < gameObject.transform.position.y && OrientationHelper.FacingLeft(transform));
        }

        return(isLeft);
    }