コード例 #1
0
 // @return the game session started
 public GameSession StartNewGameSession() {
   GameObject sessionGameObject = new GameObject("GameSession");
   sessionGameObject.transform.SetParent(this.transform);
   
   GameSession newGameSession = sessionGameObject.AddComponent<GameSession>();
   newGameSession.OnGameSessionFinished += this.HandleGameSessionFinished;
   this.ActiveGameSession = newGameSession;
   
   return newGameSession;
 }
コード例 #2
0
 // PRAGMA MARK - Internal
 protected void HandleGameSessionFinished(GameSession finishedGameSession) {
   finishedGameSession.OnGameSessionFinished -= this.HandleGameSessionFinished;
   if (finishedGameSession == this.ActiveGameSession) {
     this.ActiveGameSession = null;
   }
 }