示例#1
0
    public void OnOpenWindow(object[] all_params)
    {
        string ui_name = all_params[0] as string;

        if (all_layouts.ContainsKey(ui_name))
        {
            Debug.LogError("打开界面,已经存在界面:  " + ui_name);

            return;
        }

        GDSKit.ui_config config = GDSKit.ui_config.GetInstance(ui_name);

        System.Type ui_type = System.Type.GetType(config.class_name);

        UILayoutBase layout = System.Activator.CreateInstance(ui_type) as UILayoutBase;

        layout.config   = config;
        layout.is_show  = true;
        layout.game_obj = ObjectPoolManager.Instance().GetObject(config.resource_name);
        layout.game_obj.transform.SetParent(cache_root, false);
        layout.OnInit();

        all_layouts.Add(ui_name, layout);
    }
示例#2
0
    public void CloseAllView()
    {
        foreach (var kv in all_layouts)
        {
            UILayoutBase layout = kv.Value;
            layout.OnDestroy();

            ObjectPoolManager.Instance().ReturnObject(layout.config.resource_name, layout.game_obj, true);
        }
        all_layouts.Clear();
    }
示例#3
0
    public void OnCloseWindow(object[] all_params)
    {
        string ui_name = all_params[0] as string;

        if (!all_layouts.ContainsKey(ui_name))
        {
            Debug.LogError("关闭界面, 界面不存在:  " + ui_name);

            return;
        }

        UILayoutBase layout = all_layouts[ui_name];

        layout.OnDestroy();

        all_layouts.Remove(ui_name);
    }
示例#4
0
    public void OnCloseWindow(object[] all_params)
    {
        string ui_name = all_params[0] as string;

        if (!all_layouts.ContainsKey(ui_name))
        {
            Debug.LogError("关闭界面, 界面不存在:  " + ui_name);

            return;
        }

        UILayoutBase layout = all_layouts[ui_name];

        layout.OnDestroy();

        ObjectPoolManager.Instance().ReturnObject(layout.config.resource_name, layout.game_obj, true);

        all_layouts.Remove(ui_name);
    }