示例#1
0
    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
    }
示例#2
0
    void OnDestroy()
    {
#if !UNITY_EDITOR
        try
        {
#endif

        Instance = null;

#if !UNITY_EDITOR
    }
    catch (Exception ex)
    {
        Logger.Error(ex.ToString());
    }
#endif
    }
示例#3
0
    void Awake()
    {
#if !UNITY_EDITOR
        try
        {
#endif

        Instance  = this;
        IsWorking = false;

#if !UNITY_EDITOR
    }
    catch (Exception ex)
    {
        Logger.Error(ex.ToString());
    }
#endif
    }