Beispiel #1
0
    private void OnGUI()
    {
        if (alpha > 0f)
        {
            if (directionToAnimate != AC_Direction.None)
            {
                SetGUIAlpha(alpha);

                if (directionToAnimate == AC_Direction.Up)
                {
                    upArrow.rect = AdvGame.GUIRect(0.5f, 0.1f, arrowSize * 2, arrowSize);
                }

                else if (directionToAnimate == AC_Direction.Down)
                {
                    downArrow.rect = AdvGame.GUIRect(0.5f, 0.9f, arrowSize * 2, arrowSize);
                }

                else if (directionToAnimate == AC_Direction.Left)
                {
                    leftArrow.rect = AdvGame.GUIRect(0.05f, 0.5f, arrowSize, arrowSize * 2);
                }

                else if (directionToAnimate == AC_Direction.Right)
                {
                    rightArrow.rect = AdvGame.GUIRect(0.95f, 0.5f, arrowSize, arrowSize * 2);
                }
            }

            else
            {
                SetGUIAlpha(alpha);

                if (upArrow.isPresent)
                {
                    upArrow.rect = AdvGame.GUIRect(0.5f, 0.1f, 0.1f, 0.05f);
                }

                if (downArrow.isPresent)
                {
                    downArrow.rect = AdvGame.GUIRect(0.5f, 0.9f, 0.1f, 0.05f);
                }

                if (leftArrow.isPresent)
                {
                    leftArrow.rect = AdvGame.GUIRect(0.05f, 0.5f, 0.05f, 0.1f);
                }

                if (rightArrow.isPresent)
                {
                    rightArrow.rect = AdvGame.GUIRect(0.95f, 0.5f, 0.05f, 0.1f);
                }
            }

            upArrow.Draw();
            downArrow.Draw();
            leftArrow.Draw();
            rightArrow.Draw();
        }
    }