コード例 #1
0
        public void AddTickListener(GameClockListener listener)
        {
            GameClockListener newListener = new GameClockListener();

            newListener = listener;
            clockListeners.Add(newListener);
        }
コード例 #2
0
 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();
 }