Exemplo n.º 1
0
    public static void DestroyUI(UIWindowBase UI)
    {
        Debug.Log("UIManager DestroyUI " + UI.name);

        if (GetIsExitsHide(UI))
        {
            RemoveHideUI(UI);
        }
        else if (GetIsExits(UI))
        {
            RemoveUI(UI);
        }

        UISystemEvent.Dispatch(UI, UIEvent.OnDestroy);  //派发OnDestroy事件
        try
        {
            UI.Dispose();
        }
        catch (Exception e)
        {
            Debug.LogError("OnDestroy :" + e.ToString());
        }
        Destroy(UI.gameObject);
    }