/// <summary> /// 热更资源 /// </summary> 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("本地资源的根目录(建议和发布配置匹配)"); _vo.localResRoot = EditorGUILayout.TextField(_vo.localResRoot); } 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 { EditorGUI.BeginDisabledGroup(true); EditorGUILayout.TextField(_vo.hotResRoot); EditorGUI.EndDisabledGroup(); } } OnDllInspectorGUI(); } else { EditorGUILayout.Space(); GUIStyle gs = new GUIStyle(); //gs.fontStyle |= FontStyle.Bold; gs.fontSize = 12; EditorGUILayout.LabelField("<color=#FF0000>使用ResMgr时资源将从Resources中加载资源</color>", gs); } }
private void OnEnable() { _model = new HotResPublishModel(); _cfg = _model.Cfg; }