void DetermineUpdateRulestate(GameplayType gameplayType, out GameplayUpdateFn gameplayUpdateFn, out BaseGameplayRulestate currentRulestate)
    {
        gameplayUpdateFn = null;
        currentRulestate = null;

        switch (gameplayType)
        {
        case GameplayType.Bot:
        {
            gameplayUpdateFn = UpdateBotGameplay;
            currentRulestate = new BotGameplayRulestate(KickMissFeedback);
        }
        break;

        case GameplayType.Guitar:
        {
            gameplayUpdateFn = UpdateGuitarGameplay;
            currentRulestate = new GuitarGameplayRulestate(KickMissFeedback);
        }
        break;

        case GameplayType.Drums:
        {
            gameplayUpdateFn = UpdateDrumsGameplay;
            currentRulestate = new DrumsGameplayRulestate(KickMissFeedback);
        }
        break;

        default:
        {
        }
        break;
        }
    }
    public override void SystemEnter()
    {
        ChartEditor editor = ChartEditor.Instance;

        GameplayType gameplayType = DetermineGameplayType(botEnabled, editor.currentGameMode);

        LoadSoundClip();

        DetermineUpdateRulestate(gameplayType, out gameplayUpdateFn, out currentRulestate);

        hitWindowFeeder.hitWindow = CreateHitWindow(gameplayType);

        ChartEditor.Instance.uiServices.SetGameplayUIActive(!botEnabled);
    }
Example #3
0
    public static void SwitchGameInput(GameplayType type)
    {
        _controls.Gameplay.Disable();
        _controls.Menu.Disable();
        _controls.Computer.Disable();
        _controls.Cutscene.Disable();

        switch (type)
        {
        case GameplayType.FirstPerson:
        {
            _controls.Gameplay.Enable();
            break;
        }

        case GameplayType.Menu:
        {
            _controls.Menu.Enable();
            break;
        }

        case GameplayType.Computer:
        {
            _controls.Computer.Enable();
            break;
        }

        case GameplayType.Cutscene:
        {
            _controls.Cutscene.Enable();
            break;
        }

        case GameplayType.Disable:
        {
            break;
        }

        default:
        {
            Debug.Log("<color=red>Input Manager</color> Не правильно введен тип управления");
            break;
        }
        }
        _gameTypeLast = _gameType;
        _gameType     = type;

        OnGameTypeChanged?.Invoke();
    }
Example #4
0
        public void SetGameplayType(GameplayType type, bool sceneReload = false)
        {
            GAMESESSION.gameplayType = type;

            if (sceneReload)
            {
                deviceVRController = GameObject.FindGameObjectWithTag("GVRMain");
            }
            switch (type)
            {
            case GameplayType.VR:
                deviceVRController.GetComponent <GvrViewer>().VRModeEnabled = true;
                gameplayType = GameplayType.VR;
                break;

            case GameplayType.Gyro:
                deviceVRController.GetComponent <GvrViewer>().VRModeEnabled = false;
                gameplayType = GameplayType.Gyro;
                break;
            }
        }
    IHitWindow CreateHitWindow(GameplayType gameplayType)
    {
        switch (gameplayType)
        {
        case GameplayType.Bot:
        {
            return(new HitWindow <NoteHitKnowledge>(GuitarTiming.frontendHitWindowTime, GuitarTiming.backendHitWindowTime));
        }

        case GameplayType.Guitar:
        {
            return(new HitWindow <GuitarNoteHitKnowledge>(GuitarTiming.frontendHitWindowTime, GuitarTiming.backendHitWindowTime));
        }

        case GameplayType.Drums:
        {
            return(new HitWindow <DrumsNoteHitKnowledge>(DrumsTiming.frontendHitWindowTime, DrumsTiming.backendHitWindowTime));
        }
        }

        return(null);
    }
Example #6
0
        public string GetRoot(GameplayType type)
        {
            string root = Root + Background;

            switch (type)
            {
            case GameplayType.Planet:
                root += PlanetsRoot;
                break;

            case GameplayType.Player:
                root += SoldierRoot + "Players";
                break;

            case GameplayType.Enemy:
                root += SoldierRoot + "Enemies";
                break;

            default:
                Debug.LogError("AddToScene Error");
                break;
            }
            return(root);
        }
Example #7
0
 public void AddToScene <T>(T entity, GameplayType type)
     where T : Base2DEntity
 {
     AddToScene(GetRoot(type), entity.transform);
 }
Example #8
0
        public override void Update(float dt, KeyboardState keyboardInput, MouseState mouseInput, GamePadState gamePadInput, Engine Engine, GameplayType gamePlayType)
        {
            //For access from Other Referenced Classes
            this.Engine = Engine;

            //Turn Off Mouse if Right Button is Down
            if (mouseInput.RightButton == ButtonState.Pressed || gamePlayType == GameplayType.level)
            {
                Engine.Game.IsMouseVisible = false;
                Yaw   += (Engine.GraphicsDevice.Viewport.Width / 2 - mouseInput.X) * dt * .12f;
                Pitch += (Engine.GraphicsDevice.Viewport.Height / 2 - mouseInput.Y) * dt * .12f;
            }
            else if (gamePlayType == GameplayType.Sandbox)
            {
                Engine.Game.IsMouseVisible = true;
            }
#endif

            WorldMatrix = Matrix.CreateFromAxisAngle(Vector3.Right, Pitch) * Matrix.CreateFromAxisAngle(Vector3.Up, Yaw);

            if (isChaseCameraMode)
            {
                Vector3 offset;
                if (transformOffset)
                {
                    offset = Matrix3X3.Transform(offsetFromChaseTarget, entityToChase.BufferedStates.InterpolatedStates.OrientationMatrix);
                }
                else
                {
                    offset = offsetFromChaseTarget;
                }
                Vector3 lookAt    = entityToChase.BufferedStates.InterpolatedStates.Position + offset;
                Vector3 backwards = WorldMatrix.Backward;

                //Find the earliest ray hit that isn't the chase target to position the camera appropriately.
                RayCastResult result;
                if (entityToChase.Space.RayCast(new Ray(lookAt, backwards), distanceToTarget, rayCastFilter, out result))
                {
                    Position = lookAt + (result.HitData.T) * backwards; //Put the camera just before any hit spot.
                }
                else
                {
                    Position = lookAt + (distanceToTarget) * backwards;
                }
            }
            else if (UseMovementControls)
            {
                //Only move around if the camera has control over its own position.
                float distance = Speed * dt;
#if !WINDOWS
                MoveForward(gamePadInput.ThumbSticks.Left.Y * distance);
                MoveRight(gamePadInput.ThumbSticks.Left.X * distance);
                if (gamePadInput.IsButtonDown(Buttons.LeftStick))
                {
                    MoveUp(distance);
                }
                if (gamePadInput.IsButtonDown(Buttons.RightStick))
                {
                    MoveUp(-distance);
                }
#endif

                if (keyboardInput.IsKeyDown(Keys.W))
                {
                    MoveForward(distance);
                }
                if (keyboardInput.IsKeyDown(Keys.S))
                {
                    MoveForward(-distance);
                }
                if (keyboardInput.IsKeyDown(Keys.A))
                {
                    MoveRight(-distance);
                }
                if (keyboardInput.IsKeyDown(Keys.D))
                {
                    MoveRight(distance);
                }
                if (keyboardInput.IsKeyDown(Keys.Q))
                {
                    MoveUp(distance);
                }
                if (keyboardInput.IsKeyDown(Keys.Z))
                {
                    MoveUp(-distance);
                }
            }

            WorldMatrix = WorldMatrix * Matrix.CreateTranslation(Position);
            View        = Matrix.Invert(WorldMatrix);

            base.Update(dt, keyboardInput, mouseInput, gamePadInput, Engine, gamePlayType);
        }