override public float Run()
        {
            Player player = KickStarter.player;

            if (KickStarter.playerInput)
            {
                if (IsSingleLockMovement())
                {
                    doLeftLock  = doUpLock;
                    doRightLock = doUpLock;
                    doDownLock  = doUpLock;
                }

                if (doUpLock == LockType.Disabled)
                {
                    KickStarter.playerInput.SetUpLock(true);
                }
                else if (doUpLock == LockType.Enabled)
                {
                    KickStarter.playerInput.SetUpLock(false);
                }

                if (doDownLock == LockType.Disabled)
                {
                    KickStarter.playerInput.SetDownLock(true);
                }
                else if (doDownLock == LockType.Enabled)
                {
                    KickStarter.playerInput.SetDownLock(false);
                }

                if (doLeftLock == LockType.Disabled)
                {
                    KickStarter.playerInput.SetLeftLock(true);
                }
                else if (doLeftLock == LockType.Enabled)
                {
                    KickStarter.playerInput.SetLeftLock(false);
                }

                if (doRightLock == LockType.Disabled)
                {
                    KickStarter.playerInput.SetRightLock(true);
                }
                else if (doRightLock == LockType.Enabled)
                {
                    KickStarter.playerInput.SetRightLock(false);
                }

                if (KickStarter.settingsManager.movementMethod != MovementMethod.PointAndClick)
                {
                    if (doJumpLock == LockType.Disabled)
                    {
                        KickStarter.playerInput.SetJumpLock(true);
                    }
                    else if (doJumpLock == LockType.Enabled)
                    {
                        KickStarter.playerInput.SetJumpLock(false);
                    }
                }

                if (IsInFirstPerson())
                {
                    if (freeAimLock == LockType.Disabled)
                    {
                        KickStarter.playerInput.SetFreeAimLock(true);
                    }
                    else if (freeAimLock == LockType.Enabled)
                    {
                        KickStarter.playerInput.SetFreeAimLock(false);
                    }
                }

                if (cursorState == LockType.Disabled)
                {
                    KickStarter.playerInput.SetInGameCursorState(false);
                }
                else if (cursorState == LockType.Enabled)
                {
                    KickStarter.playerInput.SetInGameCursorState(true);
                }

                if (doRunLock != PlayerMoveLock.NoChange)
                {
                    KickStarter.playerInput.runLock = doRunLock;
                }
            }

            if (player)
            {
                if (movePath)
                {
                    player.SetLockedPath(movePath);
                    player.SetMoveDirectionAsForward();
                }
                else if (player.GetPath())
                {
                    player.EndPath();
                }

                if (doGravityLock == LockType.Enabled)
                {
                    player.ignoreGravity = false;
                }
                else if (doGravityLock == LockType.Disabled)
                {
                    player.ignoreGravity = true;
                }

                if (AllowHeadTurning())
                {
                    if (doHotspotHeadTurnLock == LockType.Disabled)
                    {
                        player.SetHotspotHeadTurnLock(true);
                    }
                    else if (doHotspotHeadTurnLock == LockType.Enabled)
                    {
                        player.SetHotspotHeadTurnLock(false);
                    }
                }
            }

            return(0f);
        }
Beispiel #2
0
        override public float Run()
        {
            Player player = KickStarter.player;

            if (KickStarter.playerInput)
            {
                if (IsSingleLockMovement())
                {
                    doLeftLock  = doUpLock;
                    doRightLock = doUpLock;
                    doDownLock  = doUpLock;
                }

                if (doUpLock == LockType.Disabled)
                {
                    KickStarter.playerInput.SetUpLock(true);
                }
                else if (doUpLock == LockType.Enabled)
                {
                    KickStarter.playerInput.SetUpLock(false);
                }

                if (doDownLock == LockType.Disabled)
                {
                    KickStarter.playerInput.isDownLocked = true;
                }
                else if (doDownLock == LockType.Enabled)
                {
                    KickStarter.playerInput.isDownLocked = false;
                }

                if (doLeftLock == LockType.Disabled)
                {
                    KickStarter.playerInput.isLeftLocked = true;
                }
                else if (doLeftLock == LockType.Enabled)
                {
                    KickStarter.playerInput.isLeftLocked = false;
                }

                if (doRightLock == LockType.Disabled)
                {
                    KickStarter.playerInput.isRightLocked = true;
                }
                else if (doRightLock == LockType.Enabled)
                {
                    KickStarter.playerInput.isRightLocked = false;
                }

                if (IsInFirstPerson())
                {
                    if (freeAimLock == LockType.Disabled)
                    {
                        KickStarter.playerInput.SetFreeAimLock(true);
                    }
                    else if (freeAimLock == LockType.Enabled)
                    {
                        KickStarter.playerInput.SetFreeAimLock(false);
                    }
                }

                if (IsUltimateFPS())
                {
                    return(0f);
                }

                if (doRunLock != PlayerMoveLock.NoChange)
                {
                    KickStarter.playerInput.runLock = doRunLock;
                }
            }

            if (player)
            {
                if (movePath)
                {
                    player.SetLockedPath(movePath);
                    player.SetMoveDirectionAsForward();
                }
                else if (player.activePath)
                {
                    player.EndPath();
                }

                if (doGravityLock == LockType.Enabled)
                {
                    player.ignoreGravity = false;
                }
                else if (doGravityLock == LockType.Disabled)
                {
                    player.ignoreGravity = true;
                }

                if (AllowHeadTurning())
                {
                    if (doHotspotHeadTurnLock == LockType.Disabled)
                    {
                        player.lockHotspotHeadTurning = true;
                    }
                    else if (doHotspotHeadTurnLock == LockType.Enabled)
                    {
                        player.lockHotspotHeadTurning = false;
                    }
                }
            }

            return(0f);
        }