Пример #1
0
        void Run(IPlayerEffect playerEffect)
        {
            switch (playerEffect)
            {
            case IWarpPlayerEffect warpPlayerEffect:
                if (!warpPlayerEffect.KeepPosition)
                {
                    playerPresenter.MoveTo(warpPlayerEffect.TargetPosition);
                }
                if (!warpPlayerEffect.KeepRotation)
                {
                    playerPresenter.RotateTo(warpPlayerEffect.TargetRotation);
                }
                break;

            case IRespawnPlayerEffect _:
                playerPresenter.Respawn();
                break;

            case ISetMoveSpeedRatePlayerEffect setMoveSpeedRatePlayerEffect:
                playerPresenter.SetMoveSpeedRate(setMoveSpeedRatePlayerEffect.MoveSpeedRate);
                break;

            case ISetJumpHeightRatePlayerEffect setJumpHeightRatePlayerEffect:
                playerPresenter.SetJumpSpeedRate(Mathf.Sqrt(setJumpHeightRatePlayerEffect.JumpHeightRate));
                break;
            }
        }
Пример #2
0
        void Run(IPlayerGimmick playerGimmick)
        {
            switch (playerGimmick)
            {
            case IWarpPlayerGimmick warpPlayerGimmick:
                if (!warpPlayerGimmick.KeepPosition)
                {
                    playerPresenter.MoveTo(warpPlayerGimmick.TargetPosition);
                }
                if (!warpPlayerGimmick.KeepRotation)
                {
                    playerPresenter.RotateTo(warpPlayerGimmick.TargetRotation);
                }
                break;

            case IRespawnPlayerGimmick _:
                playerPresenter.Respawn();
                break;
            }
        }