コード例 #1
0
    public void DrawHotReLoadUI()
    {
        GUILayout.BeginHorizontal("HelpBox");
        EditorGUILayout.LabelField("== 热重载 ==");
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        if (GUILayout.Button("重载配置表", GUILayout.ExpandWidth(true), GUILayout.MaxHeight(30)))
        {
            SettingsManager.AllSettingsReload();
        }

        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("快速编译配置表", GUILayout.ExpandWidth(true), GUILayout.MaxHeight(30)))
        {
            SettingModuleEditor.QuickCompileSettings();
        }

        if (GUILayout.Button("编译配置表并生成代码", GUILayout.ExpandWidth(true), GUILayout.MaxHeight(30)))
        {
            SettingModuleEditor.CompileSettings();
        }

        GUILayout.EndHorizontal();
#if xLua || SLUA
        GUILayout.BeginHorizontal();
        if (GUILayout.Button("重载所有UI的Lua代码", GUILayout.ExpandWidth(true), GUILayout.MaxHeight(30)))
        {
            KSFrameworkEditor.ReloadAllUIScript();
        }

        if (GUILayout.Button("重新打开所有UI", GUILayout.ExpandWidth(true), GUILayout.MaxHeight(30)))
        {
            KSFrameworkEditor.ReloadAllUI();
        }

        GUILayout.EndHorizontal();

        GUILayout.Space(10);
        GUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("UI名字:", GUILayout.Width(40));
        reloadUIScript = EditorGUILayout.TextField(reloadUIScript, GUILayout.MinWidth(120), GUILayout.MaxHeight(30));
        panelType      = (PanelType)EditorGUILayout.EnumPopup("", panelType, GUILayout.MinWidth(80), GUILayout.MinHeight(30));
        if (panelType != PanelType.HeadInfoUI && Application.isPlaying)
        {
            topUI = UIModule.Instance.GetTopUI(panelType);
            //Log.Info($"now top ui:{topUI?.UIName}");
            if (topUI != null)
            {
                reloadUIScript = topUI.UIName;
            }
        }
        if (GUILayout.Button("重载Lua脚本", GUILayout.MinWidth(100), GUILayout.MaxHeight(30)))
        {
            KSFrameworkEditor.ReloadUIScript(reloadUIScript);
        }

        GUILayout.EndHorizontal();
#endif
        GUILayout.Space(10);
        GUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("UI名字:", GUILayout.Width(40));
        reloadUIAb = EditorGUILayout.TextField(reloadUIAb, GUILayout.MinWidth(120), GUILayout.MaxHeight(30));
        if (GUILayout.Button("重载AB并打开", GUILayout.MinWidth(100), GUILayout.MaxHeight(30)))
        {
            KSFrameworkEditor.ReloadUIAB(reloadUIAb);
        }

        GUILayout.EndHorizontal();
        //GUILayout.Space(10);
    }
コード例 #2
0
    public void DrawHotReLoadUI()
    {
        GUILayout.BeginHorizontal("HelpBox");
        EditorGUILayout.LabelField("== 热重载 ==");
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        if (GUILayout.Button("重载配置表", GUILayout.ExpandWidth(true), GUILayout.MaxHeight(30)))
        {
            //TODO 仅仅是重载编译后的配置表
            //SettingsManager.AllSettingsReload();
        }

        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("快速编译配置表", GUILayout.ExpandWidth(true), GUILayout.MaxHeight(30)))
        {
            SettingModuleEditor.QuickCompileSettings();
        }

        if (GUILayout.Button("编译配置表并生成代码", GUILayout.ExpandWidth(true), GUILayout.MaxHeight(30)))
        {
            SettingModuleEditor.CompileSettings();
        }

        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("重载所有UI的Lua代码", GUILayout.ExpandWidth(true), GUILayout.MaxHeight(30)))
        {
            KSFrameworkEditor.ReloadAllUIScript();
        }

        if (GUILayout.Button("重新打开所有UI", GUILayout.ExpandWidth(true), GUILayout.MaxHeight(30)))
        {
            KSFrameworkEditor.ReloadAllUI();
        }

        GUILayout.EndHorizontal();

        GUILayout.Space(10);
        GUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("UI名字:", GUILayout.Width(40));
        reloadUIScript = EditorGUILayout.TextField(reloadUIScript, GUILayout.MinWidth(120), GUILayout.MaxHeight(30));
        if (GUILayout.Button("重载Lua脚本", GUILayout.MinWidth(100), GUILayout.MaxHeight(30)))
        {
            KSFrameworkEditor.ReloadUIScript(reloadUIScript);
        }

        GUILayout.EndHorizontal();
        GUILayout.Space(10);
        GUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("UI名字:", GUILayout.Width(40));
        reloadUIAb = EditorGUILayout.TextField(reloadUIAb, GUILayout.MinWidth(120), GUILayout.MaxHeight(30));
        if (GUILayout.Button("重载AB并打开", GUILayout.MinWidth(100), GUILayout.MaxHeight(30)))
        {
            KSFrameworkEditor.ReloadUIAB(reloadUIAb);
        }

        GUILayout.EndHorizontal();
        //GUILayout.Space(10);
    }