예제 #1
0
    public void ChangeBallColor(float verPos, float horPos)
    {
        horPos *= 40;
        verPos *= 40;
        if (!playerInsideObject)
        {
            if (Mathf.Abs(horPos) > deadZoneValue || Mathf.Abs(verPos) > deadZoneValue)
            {
                playerUIManager.DisplayColorSelector(true);

                if (verPos > horPos && verPos > horPos * -1)
                {
                    RedChoosed();
                }
                else if (verPos < horPos && verPos < horPos * -1)
                {
                    YellowChoosed();
                }
                else if (horPos > verPos && horPos > verPos * -1)
                {
                    GreenChoosed();
                }
                else if (horPos < verPos && horPos < verPos * -1)
                {
                    BlueChoosed();
                }
            }
            else
            {
                playerUIManager.DisplayColorSelector(false);
            }
        }
        else
        {
            playerUIManager.DisplayColorSelector(false);
        }

        playerUIManager.MoveColorSelector(new Vector3(horPos * -1, verPos, 0));
    }