コード例 #1
0
    /// <summary>
    /// 加载window
    /// </summary>
    /// <param name="windowName"></param>
    void LoadWindow(string windowName)
    {
        string path      = PathManager.GetWindowPath(windowName);
        var    obj       = ResourceManager.Load <GameObject>(path);
        var    windowObj = PoolManager.InstantiateGameObject(obj, PoolType.Window);

        windowObj.transform.SetParent(MainCanvas.transform, false);
        UIWindowBase window = windowObj.GetComponent <UIWindowBase>();

        _windowDict.Add(windowObj.name, window);
        var uiDict = window.LoadAllUI();

        RegistUI(window, uiDict);
        window.Init();
    }
コード例 #2
0
ファイル: UIManager.cs プロジェクト: fqkw6/MyUnityFrameWork
    public static UIWindowBase CreateUIWindow(string l_UIname)
    {
        GameObject   l_UItmp  = GameObjectManager.CreatGameObject(l_UIname, s_Instance.gameObject);
        UIWindowBase l_UIbase = l_UItmp.GetComponent <UIWindowBase>();

        UISystemEvent.Dispatch(l_UIbase, UIEvent.OnInit);  //派发OnInit事件
        try{
            l_UIbase.Init();
        }
        catch (Exception e) {
            Debug.LogError("OnInit Exception: " + e.ToString());
        }

        AddHideUI(l_UIbase);

        return(l_UIbase);
    }
コード例 #3
0
ファイル: UIManager.cs プロジェクト: colourstar/SongofTrojan
    public static UIWindowBase CreateUIWindow(string UIName)
    {
        GameObject   UItmp  = GameObjectManager.CreateGameObject(UIName, s_UIManagerGo);
        UIWindowBase UIbase = UItmp.GetComponent <UIWindowBase>();

        UISystemEvent.Dispatch(UIbase, UIEvent.OnInit);  //派发OnInit事件
        try{
            UIbase.Init(GetUIID(UIName));
        }
        catch (Exception e)
        {
            Debug.LogError("OnInit Exception: " + e.ToString());
        }

        AddHideUI(UIbase);

        s_UILayerManager.SetLayer(UIbase);      //设置层级

        return(UIbase);
    }