示例#1
0
    void InitEventTriggers(bool register = true)
    {
        if (register)
        {
            if (pubInstance == null)
            {
                pubInstance = EventPublisherListener.Instance;
                if (pubInstance == null)
                {
                    Debug.Log(" Unable to load EventPublisherListener");
                }
            }

            pubInstance.Register("AssignedCross", this.AssignedCross);
            pubInstance.Register("AssignedNot", this.AssignedNot);

            pubInstance.Register("ResetGame", this.ResetGame);
            pubInstance.Register("TogglePlayer", this.TogglePlayer);
            pubInstance.Register("GameOverInteractive", this.GameOverInteractive);
        }
        else if (pubInstance != null)
        {
            pubInstance.UnRegister("AssignedCross", this.AssignedCross);
            pubInstance.UnRegister("AssignedNot", this.AssignedNot);
            pubInstance.UnRegister("ResetGame", this.ResetGame);
            pubInstance.UnRegister("TogglePlayer", this.TogglePlayer);
            pubInstance.UnRegister("GameOverInteractive", this.GameOverInteractive);
        }
    }
 void InitEventTriggers(bool register = true)
 {
     if (register)
     {
         if (pubInstance == null)
         {
             pubInstance = EventPublisherListener.Instance;
             if (pubInstance == null)
             {
                 Debug.Log(" Unable to load EventPublisherListener");
             }
         }
         pubInstance.Register("StartGame", this.StartGame);
         pubInstance.Register("AssignedCross", this.AssignedCross);
         pubInstance.Register("AssignedNot", this.AssignedNot);
         pubInstance.Register("AgentReset", this.ResetAgent);
     }
     else if (pubInstance != null)
     {
         pubInstance.UnRegister("StartGame", this.StartGame);
         pubInstance.UnRegister("AssignedCross", this.AssignedCross);
         pubInstance.UnRegister("AssignedNot", this.AssignedNot);
         pubInstance.UnRegister("AgentReset", this.ResetAgent);
     }
 }
示例#3
0
 public void UnRegister(string eventName, EventPublisherListener.EventHandler gameEventHandler)
 {
     pubInstance.UnRegister(eventName, gameEventHandler);
 }