コード例 #1
0
        protected virtual void OnGameStateChanged(object sender, GameStateEventArgs e)
        {
            var handler = GameStateChanged;

            if (handler != null)
            {
                handler(this, e);
            }
        }
コード例 #2
0
    /// <summary>
    /// Raises the game state changed event. This is the main entry point for all
    /// game state event changes.
    /// </summary>
    /// <param name="sender">Sender object.</param>
    /// <param name="e">The event arguments.</param>
    /// <remarks>
    /// This handles all game state changes, so you can just use one function to
    /// call all the events.
    /// 
    /// This method will then call more specific event invocators, so that objects
    /// dependent on those specific events can listen to those, and don't have
    /// to check whether they have to do something themselves.
    /// </remarks>
    public void RaiseGameStateChanged (object sender, GameStateEventArgs e)
    {
      // General Game state event.
      OnGameStateChanged (sender, e);

      // Call more specific events
      var handler = gameStateEvents [e.NewState];
      if (handler != null)
        handler (sender, e);

    }
コード例 #3
0
        /// <summary>
        /// Raises the game state changed event. This is the main entry point for all
        /// game state event changes.
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="e">The event arguments.</param>
        /// <remarks>
        /// This handles all game state changes, so you can just use one function to
        /// call all the events.
        ///
        /// This method will then call more specific event invocators, so that objects
        /// dependent on those specific events can listen to those, and don't have
        /// to check whether they have to do something themselves.
        /// </remarks>
        public void RaiseGameStateChanged(object sender, GameStateEventArgs e)
        {
            // General Game state event.
            OnGameStateChanged(sender, e);

            // Call more specific events
            var handler = gameStateEvents [e.NewState];

            if (handler != null)
            {
                handler(sender, e);
            }
        }
コード例 #4
0
 void GameEventsBroadcaster_Instance_PauseGame(object sender, GameStateEventArgs e)
 {
     Debug.Log("[Test] This is shown when the PauseEnter event has been fired.");
 }
コード例 #5
0
 void GameEventsBroadcaster_Instance_PauseGame1(object sender, GameStateEventArgs e)
 {
     Debug.Log("[Test] Oh hai. Calling from the second handler.");
 }
コード例 #6
0
 void Counter(object sender, GameStateEventArgs e)
 {
 }
コード例 #7
0
 void Fail(object sender, GameStateEventArgs e)
 {
     Assert.Fail("Handler has been called although it shouldnt.");
 }
コード例 #8
0
 void Pass(object sender, GameStateEventArgs e)
 {
     Assert.Pass("Handler Pass 1 has been executed.");
 }
コード例 #9
0
 protected virtual void OnGameStateChanged (object sender, GameStateEventArgs e)
 {
   var handler = GameStateChanged;
   if (handler != null)
     handler (this, e);
 }
コード例 #10
0
 void GameEventsBroadcaster_Instance_PauseGame (object sender, GameStateEventArgs e)
 {
   Debug.Log ("[Test] This is shown when the PauseEnter event has been fired.");
 }
コード例 #11
0
 void GameEventsBroadcaster_Instance_PauseGame1 (object sender, GameStateEventArgs e)
 {
   Debug.Log ("[Test] Oh hai. Calling from the second handler.");
 }
コード例 #12
0
    void Counter (object sender, GameStateEventArgs e)
    {

    }
コード例 #13
0
 void Fail (object sender, GameStateEventArgs e)
 {
   Assert.Fail ("Handler has been called although it shouldnt."); 
 }
コード例 #14
0
    void Pass (object sender, GameStateEventArgs e)
    {
      Assert.Pass ("Handler Pass 1 has been executed.");

    }