public void AddTickListener(GameClockListener listener)
        {
            GameClockListener newListener = new GameClockListener();

            newListener = listener;
            clockListeners.Add(newListener);
        }
 public void RemoveTickListener(GameClockListener listener)
 {
     if (clockListeners.Contains(listener))
     {
         clockListeners.Remove(listener);
     }
     else
     {
         Debug.LogError("Attempted to remove GameClockListener that does not exist.");
     }
 }
示例#3
0
 private void AttachLocalComponents()
 {
     if (myGameClockListener == null)
     {
         myGameClockListener = gameObject.GetComponent <GameClockListener>();
         if (myGameClockListener == null)
         {
             gameObject.AddComponent <GameClockListener>();
             myGameClockListener = gameObject.GetComponent <GameClockListener>();
         }
     }
     AttachEvents();
 }