Пример #1
0
 public void ChangeGameState(GameState newState)
 {
     GameRequest request = new GameRequest ();
                 request.type = GameRequest.Type.ChangeGameStateRequest;
                 request.newGameState = newState;
                 mRequestQueue.Enqueue (request);
 }
Пример #2
0
 public void Translate(Vector3 movementVector)
 {
     GameRequest request = new GameRequest ();
                 request.type = GameRequest.Type.TranslateShapeRequest;
                 request.translationData.movementVector = movementVector;
                 mRequestQueue.Enqueue (request);
 }
Пример #3
0
 public void Rotate()
 {
     GameRequest request = new GameRequest ();
                 request.type = GameRequest.Type.RotateShapeRequest;
                 mRequestQueue.Enqueue (request);
 }
Пример #4
0
 private void HandleTranslateShapeRequest(GameRequest request)
 {
     mScene.HandleTranslateRequest (request.translationData.movementVector);
 }
Пример #5
0
 private void HandleRotateShapeRequest(GameRequest request)
 {
     mScene.HandleRotateRequest ();
 }
Пример #6
0
        private void HandleChangeGameStateRequest(GameRequest request)
        {
            UnityEngine.Debug.Log (" currentGameState: " + mCurrentGameState.ToString () + " request.newGameState: " + request.newGameState.ToString ());
                        if (request.newGameState == AssemblyCSharp.GameState.Running &&
                                ((mCurrentGameState & (AssemblyCSharp.GameState.None | AssemblyCSharp.GameState.Ended)) != 0)) {
                                mScene.Initialize (24, 8, SHAPE_RULESET_OPTION); //start new game
                        }
                        if (request.newGameState == AssemblyCSharp.GameState.Ended) {
                                mLeaderboard.AddHighScore (mScene.GetCurrentScore ());
                                mScene.Cleanup (); //cleanup game
                        }

                        mCurrentGameState = request.newGameState;
        }