public void UnRegisterListener(IPaletteUpdater source) { //Debug.Log(Time.frameCount+" unregregistering listener "+source.name,source.gameObject); //onPaletteChange-=source.UpdatePalette; if (listeners == null) { listeners = new List <IPaletteUpdater>(); } if (!listeners.Contains(source)) { Debug.Log("list does not contain this object " + source.name, source.gameObject); } listeners.Remove(source); }
public void RegisterListener(IPaletteUpdater source) { if (listeners == null) { listeners = new List <IPaletteUpdater>(); } if (listeners.Contains(source)) { // Debug.Log(Time.frameCount + " we already have ths soruce", source.gameObject); } else { // Debug.Log(Time.frameCount + " adding " + source.name,source.gameObject); listeners.Add(source); } }