/// <summary>
        /// 热更资源
        /// </summary>
        private void OnHotResInspectorGUI()
        {
            EditorGUILayout.Space();
            _vo.isHotResProject = EditorGUILayout.Toggle("使用热更", _vo.isHotResProject);
            if (_vo.isHotResProject)
            {
                EditorGUI.indentLevel = 1;

                EditorGUILayout.Space();
                _vo.hotResMode = (EHotResMode)EditorGUILayout.Popup("资源来源", (int)_vo.hotResMode, new string[] { "从网络资源目录加载资源", "从本地资源目录加载资源", "使用AssetDataBase加载资源(推荐开发阶段使用)" });

                if (EHotResMode.NET_ASSET_BUNDLE == _vo.hotResMode)
                {
                    EditorGUILayout.Space();
                    EditorGUILayout.LabelField("网络资源的根目录");
                    _vo.netRoot = EditorGUILayout.TextField(_vo.netRoot);
                }
                else if (EHotResMode.LOCAL_ASSET_BUNDLE == _vo.hotResMode)
                {
                    EditorGUILayout.Space();
                    EditorGUILayout.LabelField("本地资源的根目录(通过菜单Zero > Publish > HotRes中的Res发布目录配置)");
                    var model = new HotResPublishModel();
                    _vo.localResRoot = model.Cfg.resDir;
                    if (string.IsNullOrEmpty(_vo.localResRoot))
                    {
                        EditorGUILayout.LabelField("<color=#FF0000>*尚未配置</color>", new GUIStyle());
                    }
                    else
                    {
                        GUI.enabled = false;
                        EditorGUILayout.TextField(_vo.localResRoot);
                        GUI.enabled = true;
                    }
                }
                else if (EHotResMode.ASSET_DATA_BASE == _vo.hotResMode)
                {
                    EditorGUILayout.Space();
                    EditorGUILayout.LabelField("Asset中热更资源目录(通过菜单Zero > Publish > HotRes中的AssetBundle配置)");
                    var model = new HotResPublishModel();
                    _vo.hotResRoot = model.Cfg.abHotResDir;
                    if (string.IsNullOrEmpty(_vo.hotResRoot))
                    {
                        EditorGUILayout.LabelField("<color=#FF0000>*尚未配置</color>", new GUIStyle());
                    }
                    else
                    {
                        GUI.enabled = false;
                        EditorGUILayout.TextField(_vo.hotResRoot);
                        GUI.enabled = true;
                    }
                }

                OnDllInspectorGUI();
            }
            else
            {
                EditorGUILayout.Space();
                GUIStyle gs = new GUIStyle();
                //gs.fontStyle |= FontStyle.Bold;
                gs.fontSize = 12;
                EditorGUILayout.LabelField("<color=#FF0000>使用ResMgr时资源将从Resources中加载资源</color>", gs);
            }
        }
Exemplo n.º 2
0
 private void OnEnable()
 {
     _model = new HotResPublishModel();
     _cfg   = _model.Cfg;
 }