public override void Activate()
        {
            base.Activate();

            _startSequenceTimer.Reset();

            ControllerPool.SetControllersToGameplayMode();

            Communication.SubSceneCommunicator playerOneCommunicator = new Communication.SubSceneCommunicator();
            Communication.SubSceneCommunicator playerTwoCommunicator = new Communication.SubSceneCommunicator();

            playerOneCommunicator.OtherPlayerDataSource = playerTwoCommunicator;
            playerTwoCommunicator.OtherPlayerDataSource = playerOneCommunicator;

            _playerOneGameplayContainer.InputProcessor      = ControllerPool.Controllers.PlayerOne;
            _playerOneGameplayContainer.Communicator        = playerOneCommunicator;
            _playerOneGameplayContainer.PlayerSkinSlotIndex = NextSceneParameters.Get <int>(Player_One_Avatar_Skin_Parameter);
            _playerOneGameplayContainer.BufferArea          = CreateDisplayArea(0);
            _playerOneGameplayContainer.Activate();

            _playerTwoGameplayContainer.InputProcessor      = ControllerPool.Controllers.PlayerTwo;
            _playerTwoGameplayContainer.Communicator        = playerTwoCommunicator;
            _playerTwoGameplayContainer.PlayerSkinSlotIndex = NextSceneParameters.Get <int>(Player_Two_Avatar_Skin_Parameter);
            _playerTwoGameplayContainer.BufferArea          = CreateDisplayArea(1);
            _playerTwoGameplayContainer.Activate();

            _dialogContainer.BufferArea = ScaledBufferFrame;
            _dialogContainer.Activate();
        }
示例#2
0
 protected override void CompleteDeactivation()
 {
     if (_nextSceneType != typeof(SurvivalGameplayScene))
     {
         MusicManager.StopMusic(); ControllerPool.SetControllersToMenuMode();
     }
     base.CompleteDeactivation();
 }
        protected override void CompleteDeactivation()
        {
            MusicManager.StopMusic();
            base.CompleteDeactivation();
            _startSequenceTimer.Reset();

            ControllerPool.SetControllersToMenuMode();
        }
示例#4
0
        public Mother(int rawStartIndex, string rawValue, Basics.ControlResult.Message messageResult, string updateBlockControlID) :
            base(rawStartIndex, rawValue, ControllerTypes.Mother, null)
        {
            this._Pool         = new ControllerPool();
            this.Scheduler     = new ControllerSchedule(ref this._Pool);
            this.MessageResult = messageResult;
            this.ProcessingUpdateBlockControlID = updateBlockControlID;

            base.Mother = this;
        }
示例#5
0
        public override void Activate()
        {
            _gameplayContainer.BufferArea            = CreateDisplayArea();
            _gameplayContainer.CameraOverspillMargin = Vector2.Zero;
            _gameplayContainer.SafeAreaOuterLimits   = new Rectangle(0, 0, Definitions.Back_Buffer_Width, Definitions.Back_Buffer_Height);

            ControllerPool.SetControllersToGameplayMode();

            base.Activate();
            _gameplayContainer.Activate();
        }
示例#6
0
        public Game1()
            : base(1440, 900, true)
            //: base(1200, 675, false)
            //: base(1280, 768, false)
            //: base(1600, 900, false)
            //: base(GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height, true)
        {
            Guide.SimulateTrialMode = false;

            ControllerPool.CreateForGame(this);
            EnsureAllContentIsVisible = true;
        }
示例#7
0
        public override void Activate()
        {
            ControllerPool.SetControllersToMenuMode();

            if (!NextSceneParameters.Get <bool>("music-already-running"))
            {
                MusicManager.PlayLoopedMusic("title");
            }

            _musicToStartOnDeactivation = "";

            base.Activate();
        }
示例#8
0
        private void HandlePlayerTwoStartDialogAction(string buttonCaption)
        {
            switch (buttonCaption)
            {
            case "Back":
                _playerOneAvatarCarousel.Cancel();
                ReturnToTitleScene();
                break;

            case "Start":
                ControllerPool.SetPlayerTwoController(_playerTwoStartDialog.ActuatingController);
                _playerTwoAvatarCarousel.Activate();
                break;
            }
        }
示例#9
0
        public override void Activate()
        {
            ControllerPool.SetControllersToMenuMode();

            if (Data.Profile.PlayingRaceMode)
            {
                _message = Translator.Translation("Please make sure both controllers are plugged in");
            }
            else
            {
                _message = Translator.Translation("Please make sure your controller is plugged in");
            }

            base.Activate();
        }
示例#10
0
        private void HandleStartDialogActionSelection(string selectedOption)
        {
            switch (selectedOption)
            {
            case "Adventure":
                Data.Profile.PlayingRaceMode = false;
                ControllerPool.SetPlayerOneController(_dialogs["start"].ActuatingController);
                ActivateDialog("survival-levels");
                break;

            case "Race":
                Data.Profile.PlayingRaceMode = true;
                ControllerPool.SetPlayerOneController(_dialogs["start"].ActuatingController);
                ControllerPool.SetPlayerTwoController(null);
                NextSceneType = typeof(Gameplay.Race.RaceStartScene);
                _titlePopup.Dismiss();
                break;

            case "Back":
                ActivateDialog("main");
                break;
            }
        }
    // Use this for initialization
    void Awake()
    {
        if (instance != null)
            Debug.LogWarning("ControllerPool: There is more than one instance of the Controller Pool in the scene.");
        else
            instance = this;
        pool = new List<Controller>();
        controllers = Input.GetJoystickNames();
        joined = string.Join(" ", controllers);
        for (int i = 0; i < controllers.Length && pool.Count < 4; i++)
        {
            if (controllers[i] != "")
            {
                AddController(controllers[i]);
            }
        }

        if (pool.Count == 0)
        {
            AddController("null");
            pool[0].Disconnected();
        }
    }
示例#12
0
        protected override void Dismiss()
        {
            ControllerPool.SetControllersToGameplayMode();

            base.Dismiss();
        }
示例#13
0
        public override void Activate()
        {
            ControllerPool.SetControllersToMenuMode();

            base.Activate();
        }
 void Destroy()
 {
     if (instance == this)
         instance = null;
 }