예제 #1
0
    public void StartMiniGame(MiniGameType miniGame, OverclockRoom room)
    {
        if (miniGame == MiniGameType.None)
        {
            return;                                // check for implemented mini-game
        }
        overclocking = true;
        activeRoom   = room;
        AudioManager.instance.PlaySFX("Overclock");
        additiveSceneManager.LoadSceneMerged(miniGame.ToString());

        AnalyticsManager.OnMiniGameStarted(miniGame);
    }
예제 #2
0
 /// <summary>
 /// Unloads this current minigame scene
 /// </summary>
 /// <param name="miniGame"></param>
 public void UnloadScene(MiniGameType miniGame)
 {
     overclocking = false;
     additiveSceneManager.UnloadScene(miniGame.ToString());
 }
    public void SetMiniGameType(MiniGameManager.MiniGameType newGameType, MiniGameSettingsBase gameSettings)        // Change game type and re-instantiate miniGameInstance
    {
        DebugBot.DebugFunctionCall("Trial; SetMiniGameType(); " + gameType.ToString(), debugFunctionCalls);
        miniGameInstance = null;
        gameType         = newGameType;  // Update GameType to new Type!

        // CREATE mini-game instance!  !!!!!!!!!!!!! Come back to this for Improvement Later!!!!!!!
        if (newGameType == MiniGameType.None)
        {
            miniGameInstance = new MiniGameBase();
            //miniGameInstance = newGameInstance as MiniGame;
        }

        /*else if(newGameType == MiniGameType.MoveToTarget3D) {
         *      MiniGameMoveToTarget3D newGameInstance = new MiniGameMoveToTarget3D();
         *      miniGameInstance = newGameInstance;
         * }
         * else if(newGameType == MiniGameType.CreatureSwimBasic) {
         * // SHOULD the input/output Lists depend on the Agent's full Genome, or should the minigame have control over hookups?
         * // ... Maybe eventually the Agent's genome should dictate, but for now, to avoid a complete re-write, will leave the ability
         * // ... of miniGame's to choose which input/output neurons to hook up. Save that change for the big NEAT update where creature
         * // ... topologies can morph and differ within a population.
         * Debug.Log("BROKEN!! MiniGameManager public void SetMiniGameType(MiniGameManager.MiniGameType newGameType)");
         *      CritterGenome templateBody = playerRef.masterPopulation.templateGenome;
         *      //MiniGameCreatureSwimBasic newGameInstance = new MiniGameCreatureSwimBasic(templateBody);
         *      //miniGameInstance = newGameInstance;
         * }*/
        else if (newGameType == MiniGameType.CritterWalkBasic)
        {
            CritterGenome templateBody = playerRef.masterPopulation.templateGenome;
            //Debug.Log("playerRef.masterPopulation.templateBodyGenome: " + playerRef.masterPopulation.templateBodyGenome.creatureBodySegmentGenomeList[0].addOn1.ToString());
            //Debug.Log("templateBody: " + templateBody.creatureBodySegmentGenomeList[0].addOn1.ToString());
            MiniGameCritterWalkBasic newGameInstance = new MiniGameCritterWalkBasic(templateBody);
            newGameInstance.UseSettings((MiniGameCritterWalkBasicSettings)gameSettings);
            newGameInstance.InitializeGame();
            miniGameInstance = newGameInstance;
            Debug.Log("miniGameInstance.inputChannelsList.Count: " + miniGameInstance.inputChannelsList.Count.ToString() + "miniGameInstance.outputChannelsList.Count: " + miniGameInstance.outputChannelsList.Count.ToString());
        }

        /*else if(newGameType == MiniGameType.RobotArmSimple) {
         *      MiniGameRobotArm newGameInstance = new MiniGameRobotArm();
         *      miniGameInstance = newGameInstance;
         * }
         * else if(newGameType == MiniGameType.PhysXWorm) {
         *      MiniGamePhysXWorm newGameInstance = new MiniGamePhysXWorm();
         *      miniGameInstance = newGameInstance;
         * }
         * else if(newGameType == MiniGameType.BallCatch) {
         *      MiniGameBallCatch newGameInstance = new MiniGameBallCatch();
         *      miniGameInstance = newGameInstance;
         * }
         * else if(newGameType == MiniGameType.ObstacleNavigation) {
         *      MiniGameObstacleNavigation newGameInstance = new MiniGameObstacleNavigation();
         *      miniGameInstance = newGameInstance;
         * }
         * else if(newGameType == MiniGameType.PoleBalancing2D) {
         *      MiniGamePoleBalancing2D newGameInstance = new MiniGamePoleBalancing2D();
         *      miniGameInstance = newGameInstance;
         * }
         * else if(newGameType == MiniGameType.SpaceshipShooter) {
         *      MiniGameSpaceshipShooter newGameInstance = new MiniGameSpaceshipShooter();
         *      miniGameInstance = newGameInstance;
         * }*/

        SetInputOutputArrays();         // Haven't set input/output lists for the minigame yet....
    }