private void Start() { #if !UNITY_EDITOR try { #endif if (Instace) { EventDispatcher.Instance.RemoveEventListener(ShowUIHintBoard.EVENT_TYPE, Instace.OnShowUIHint); EventDispatcher.Instance.RemoveEventListener(UIEvent_ErrorTip.EVENT_TYPE, Instace.OnShowErrorTip); Instace = null; } Instace = this; EventDispatcher.Instance.AddEventListener(ShowUIHintBoard.EVENT_TYPE, Instace.OnShowUIHint); EventDispatcher.Instance.AddEventListener(UIEvent_ErrorTip.EVENT_TYPE, Instace.OnShowErrorTip); #if !UNITY_EDITOR } catch (Exception ex) { Logger.Error(ex.ToString()); } #endif }
void OnDestroy() { #if !UNITY_EDITOR try { #endif Instance = null; #if !UNITY_EDITOR } catch (Exception ex) { Logger.Error(ex.ToString()); } #endif }
void Awake() { #if !UNITY_EDITOR try { #endif Instance = this; IsWorking = false; #if !UNITY_EDITOR } catch (Exception ex) { Logger.Error(ex.ToString()); } #endif }