首次提交
This commit is contained in:
46
Assets/Scripts/NBC/Asset/Editor/Defs/AddressMode.cs
Normal file
46
Assets/Scripts/NBC/Asset/Editor/Defs/AddressMode.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
namespace NBC.Asset.Editor
|
||||
{
|
||||
public enum AddressMode
|
||||
{
|
||||
/// <summary>
|
||||
/// 不启用寻址
|
||||
/// </summary>
|
||||
[DisplayName(Language.AddressModeNone)] None,
|
||||
|
||||
/// <summary>
|
||||
/// 文件名
|
||||
/// </summary>
|
||||
[DisplayName(Language.AddressModeFileName)]
|
||||
FileName,
|
||||
|
||||
/// <summary>
|
||||
/// 分组名+文件名
|
||||
/// </summary>
|
||||
[DisplayName(Language.AddressModeGroupAndFileName)]
|
||||
GroupAndFileName,
|
||||
|
||||
/// <summary>
|
||||
/// 收集源名称+文件名
|
||||
/// </summary>
|
||||
[DisplayName(Language.AddressModeCollectorAndFileName)]
|
||||
CollectorAndFileName,
|
||||
|
||||
/// <summary>
|
||||
/// 包名+组名+文件名
|
||||
/// </summary>
|
||||
[DisplayName(Language.AddressModePackAndGroupAndFileName)]
|
||||
PackAndGroupAndFileName,
|
||||
|
||||
/// <summary>
|
||||
/// 包名+文件名
|
||||
/// </summary>
|
||||
[DisplayName(Language.AddressModePackAndFileName)]
|
||||
PackAndFileName,
|
||||
|
||||
/// <summary>
|
||||
/// 包名+收集源名称+文件名
|
||||
/// </summary>
|
||||
[DisplayName(Language.AddressModePackAndCollectorAndFileName)]
|
||||
PackAndCollectorAndFileName,
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/NBC/Asset/Editor/Defs/AddressMode.cs.meta
Normal file
3
Assets/Scripts/NBC/Asset/Editor/Defs/AddressMode.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eeac94539b094cccb8b270ac674e7373
|
||||
timeCreated: 1678157999
|
||||
35
Assets/Scripts/NBC/Asset/Editor/Defs/BundleMode.cs
Normal file
35
Assets/Scripts/NBC/Asset/Editor/Defs/BundleMode.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
namespace NBC.Asset.Editor
|
||||
{
|
||||
public enum BundleMode
|
||||
{
|
||||
/// <summary>
|
||||
/// 一个ab
|
||||
/// </summary>
|
||||
[DisplayName(Language.BundleModeSingle)]
|
||||
Single,
|
||||
|
||||
/// <summary>
|
||||
/// 按文件夹(每个独立文件夹为一个ab包)
|
||||
/// </summary>
|
||||
[DisplayName(Language.BundleModeFolder)]
|
||||
Folder,
|
||||
|
||||
/// <summary>
|
||||
/// 父级文件夹
|
||||
/// </summary>
|
||||
[DisplayName(Language.BundleModeFolderParent)]
|
||||
FolderParent,
|
||||
|
||||
/// <summary>
|
||||
/// 每个文件一个ab
|
||||
/// </summary>
|
||||
[DisplayName(Language.BundleModeFile)]
|
||||
File,
|
||||
|
||||
/// <summary>
|
||||
/// 忽略子文件夹
|
||||
/// </summary>
|
||||
[DisplayName(Language.BundleModeWithoutSub)]
|
||||
WithoutSub
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/NBC/Asset/Editor/Defs/BundleMode.cs.meta
Normal file
3
Assets/Scripts/NBC/Asset/Editor/Defs/BundleMode.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bcf5ff2b184f44d394f6d2837c124146
|
||||
timeCreated: 1675826079
|
||||
64
Assets/Scripts/NBC/Asset/Editor/Defs/Defs.cs
Normal file
64
Assets/Scripts/NBC/Asset/Editor/Defs/Defs.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace NBC.Asset.Editor
|
||||
{
|
||||
public static class TaskId
|
||||
{
|
||||
/// <summary>
|
||||
/// 收集资源
|
||||
/// </summary>
|
||||
public const int Gather = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 打包bundle
|
||||
/// </summary>
|
||||
public const int BuildBundle = 2;
|
||||
|
||||
/// <summary>
|
||||
/// 生成版本清单
|
||||
/// </summary>
|
||||
public const int GenPackageData = 3;
|
||||
|
||||
/// <summary>
|
||||
/// 生成版本清单
|
||||
/// </summary>
|
||||
public const int GenVersionData = 4;
|
||||
|
||||
/// <summary>
|
||||
/// 拷贝bundle和版本清单
|
||||
/// </summary>
|
||||
public const int CopyVersionBundle = 5;
|
||||
|
||||
/// <summary>
|
||||
/// 拷贝至StreamingAssets
|
||||
/// </summary>
|
||||
public const int CopyToStreamingAssets = 6;
|
||||
}
|
||||
|
||||
public class Defs
|
||||
{
|
||||
public static void AddTag(string tag)
|
||||
{
|
||||
if (!UserTags.Contains(tag))
|
||||
{
|
||||
UserTags.Add(tag);
|
||||
}
|
||||
}
|
||||
|
||||
public static readonly List<string> UserTags = new List<string>() { };
|
||||
|
||||
public const float DefWindowWidth = 960;
|
||||
public const float DefWindowHeight = 600;
|
||||
|
||||
#if UNITY_2019_4_OR_NEWER
|
||||
public static readonly Type[] DockedWindowTypes =
|
||||
{
|
||||
typeof(CollectorWindow),
|
||||
typeof(ProfilerWindow),
|
||||
typeof(BuilderWindow),
|
||||
typeof(HistoryWindow)
|
||||
};
|
||||
#endif
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/NBC/Asset/Editor/Defs/Defs.cs.meta
Normal file
3
Assets/Scripts/NBC/Asset/Editor/Defs/Defs.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1f71f781e73b4b898ae6bd3121528051
|
||||
timeCreated: 1675824656
|
||||
44
Assets/Scripts/NBC/Asset/Editor/Defs/FilterEnum.cs
Normal file
44
Assets/Scripts/NBC/Asset/Editor/Defs/FilterEnum.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
namespace NBC.Asset.Editor
|
||||
{
|
||||
public enum FilterEnum
|
||||
{
|
||||
//全部
|
||||
All = 0,
|
||||
//预制体
|
||||
Prefab,
|
||||
//场景
|
||||
Scene,
|
||||
//题图
|
||||
Texture,
|
||||
//精灵图片
|
||||
Sprite,
|
||||
//文件资产
|
||||
TextAsset,
|
||||
//材质
|
||||
Material,
|
||||
//网格
|
||||
Mesh,
|
||||
//字体
|
||||
Font,
|
||||
//模型
|
||||
Model,
|
||||
//着色器
|
||||
Shader,
|
||||
//音频
|
||||
AudioClip,
|
||||
//音频混音器
|
||||
AudioMixer,
|
||||
//视频
|
||||
VideoClip,
|
||||
//动画
|
||||
AnimationClip,
|
||||
//物理材质
|
||||
PhysicMaterial,
|
||||
//脚本
|
||||
Script,
|
||||
//动画控制器
|
||||
RuntimeAnimatorController,
|
||||
//自定义
|
||||
Custom
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/NBC/Asset/Editor/Defs/FilterEnum.cs.meta
Normal file
3
Assets/Scripts/NBC/Asset/Editor/Defs/FilterEnum.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 79a86eb49eaf4efaa7869d03d5a41de5
|
||||
timeCreated: 1678157766
|
||||
134
Assets/Scripts/NBC/Asset/Editor/Defs/Language.cs
Normal file
134
Assets/Scripts/NBC/Asset/Editor/Defs/Language.cs
Normal file
@@ -0,0 +1,134 @@
|
||||
namespace NBC.Asset.Editor
|
||||
{
|
||||
public static class Language
|
||||
{
|
||||
public const string AssetPackageName = "资源包";
|
||||
public const string AddPackage = "添加资源包";
|
||||
public const string EnableDefPackage = "设为默认包";
|
||||
public const string DisableDefPackage = "设为附加包";
|
||||
|
||||
public const string Enable = "启用";
|
||||
public const string Disable = "禁用";
|
||||
|
||||
public const string AssetGroupName = "资源组";
|
||||
public const string AddGroup = "添加资源组";
|
||||
|
||||
public const string Del = "删除";
|
||||
public const string ReName = "重命名";
|
||||
public const string Success = "成功";
|
||||
public const string Tips = "提示";
|
||||
public const string Confirm = "确定";
|
||||
public const string Error = "错误";
|
||||
|
||||
public const string AddressPath = "寻址地址";
|
||||
public const string FileSize = "文件大小";
|
||||
public const string Path = "真实地址";
|
||||
public const string CopyPath = "拷贝真实地址";
|
||||
public const string CopyAddressPath = "拷贝寻址地址";
|
||||
|
||||
|
||||
public const string NoSelectGroup = "没有选中的资源组";
|
||||
public const string GroupBundleMode = "打包模式";
|
||||
public const string GroupAddressMode = "寻址模式";
|
||||
public const string Tags = "资源标签";
|
||||
public const string Filter = "过滤器规则";
|
||||
public const string FilterCustom = "自定义过滤器规则";
|
||||
public const string CollectorTitle = "收集源{0}";
|
||||
|
||||
public const string RepetitiveName = "重复的名字";
|
||||
|
||||
public const string Save = "保存";
|
||||
public const string Build = "构建";
|
||||
public const string Tools = "工具";
|
||||
public const string Profiler = "资源监视";
|
||||
public const string Analyse = "资源分析";
|
||||
|
||||
public const string CollectorWindowName = "资源收集器";
|
||||
public const string ProfilerWindowName = "资源监视器";
|
||||
public const string BuilderWindowName = "资源构建器";
|
||||
public const string HistoryWindowName = "历史记录操作器";
|
||||
|
||||
public const string CollectorWindowMenuPath = "NBC/资源系统/资源收集器";
|
||||
public const string ProfilerWindowNameMenuPath = "NBC/资源系统/资源监视器";
|
||||
public const string BuilderWindowNameMenuPath = "NBC/资源系统/资源构建器";
|
||||
public const string HistoryWindowNameMenuPath = "NBC/资源系统/历史记录操作器";
|
||||
|
||||
public const string MenuDownloadPath = "NBC/资源系统/目录/下载解压目录";
|
||||
public const string MenuBuildPath = "NBC/资源系统/目录/构建目录";
|
||||
public const string MenuCachePath = "NBC/资源系统/目录/缓存目录";
|
||||
|
||||
public const string AddressModeNone = "不启用";
|
||||
public const string AddressModeFileName = "文件名";
|
||||
public const string AddressModeGroupAndFileName = "分组名+文件名";
|
||||
public const string AddressModeCollectorAndFileName = "收集源名称+文件名";
|
||||
public const string AddressModePackAndGroupAndFileName = "包名+组名+文件名";
|
||||
public const string AddressModePackAndFileName = "包名+文件名";
|
||||
public const string AddressModePackAndCollectorAndFileName = "包名+收集源名称+文件名";
|
||||
|
||||
public const string BundleModeSingle = "打包为一个AB";
|
||||
public const string BundleModeFolder = "每个独立文件夹为一个AB";
|
||||
public const string BundleModeFolderParent = "每个源文件夹为一个AB";
|
||||
public const string BundleModeFile = "每个文件一个AB";
|
||||
public const string BundleModeWithoutSub = "打包为一个AB且忽略子文件夹";
|
||||
|
||||
public const string LabelHintIdle = "输入筛选或添加新标签";
|
||||
public const string LabelHintSearchFoundIsEnabled = "<b>回车</b> 增加 '{0}'";
|
||||
public const string LabelHintSearchFoundIsDisabled = "<b>回车</b> 删除 '{0}'";
|
||||
|
||||
public const string InspectorUIAddressPath = "寻址路径: ";
|
||||
public const string InspectorUIPath = "真实路径: ";
|
||||
public const string InspectorUITitle = "文件可寻址信息";
|
||||
public const string InspectorUITitleNotOpen = "文件可寻址信息(未开启)";
|
||||
public const string Copy = "复制";
|
||||
|
||||
public const string ProfilerShowMode = "显示模式:";
|
||||
public const string ProfilerAssetMode = "资源";
|
||||
public const string ProfilerBundleMode = "资源包";
|
||||
public const string ImportProfiler = "导入";
|
||||
public const string ImportProfilerTips = "选择要导入文件";
|
||||
public const string BuildProfiler = "导出";
|
||||
public const string BuildProfilerTips = "选择要导出的目录";
|
||||
public const string Current = "采样";
|
||||
public const string Clear = "清理";
|
||||
public const string CurrentFrame = "当前帧:";
|
||||
public const string PrevFrame = "|上一帧";
|
||||
public const string NextFrame = "|下一帧";
|
||||
public const string ProfilerAssetPath = "资源路径";
|
||||
public const string ProfilerAssetType = "资源类型";
|
||||
public const string ProfilerLoadTime = "加载时间";
|
||||
public const string ProfilerStatus = "状态";
|
||||
public const string ProfilerLoadTotalTime = "加载耗时";
|
||||
public const string ProfilerLoadScene = "加载场景";
|
||||
public const string ProfilerRefCount = "引用数量";
|
||||
public const string ProfilerBundleName = "Bundle包名";
|
||||
public const string ProfilerDataMode = "数据源:";
|
||||
public const string ProfilerLocalData = "本地";
|
||||
public const string ProfilerRemoteData = "远程";
|
||||
public const string ProfilerRemoteUrl = "远程连接地址:";
|
||||
public const string ProfilerRemoteUrlIsNull = "远程连接地址未设置";
|
||||
|
||||
|
||||
public const string BuildBundleName = "构建AB包";
|
||||
public const string BuildStart = "立即构建";
|
||||
public const string BuildSuccessTips = "构建成功。热更内容大小:{0},新增Bundle:{1},修改Bunlde:{2},删除Bundle:{3}";
|
||||
|
||||
public const string HistoryVersionName = "历史打包版本";
|
||||
public const string HistoryBundleName = "资源包名";
|
||||
public const string HistoryHash = "资源哈希";
|
||||
public const string HistorySize = "大小";
|
||||
public const string HistoryDelete = "删除记录";
|
||||
public const string HistorySelectCompare = "选中为比较版本";
|
||||
public const string HistoryUnSelectCompare = "取消比较选中";
|
||||
public const string HistoryCompareBuild = "保存对比结果清单";
|
||||
public const string NoSelectHistoryCompareVersion = "无法显示比较信息:没有选中需要比较的旧版本,请在左侧侧栏中右键菜单选择要进行比较的旧版本";
|
||||
public const string NoSelectHistoryCompareOneVersion = "选中版本与当前版本一致";
|
||||
public const string HistoryBundleChangeTitle = "总数:{0} ({1})";
|
||||
public const string HistoryAddBundleCount = "新增的Bundle数";
|
||||
public const string HistoryChangeBundleCount = "修改的Bundle数";
|
||||
public const string HistoryRemoveBundleCount = "删除的Bundle包";
|
||||
public const string HistoryDownloadSize = "更新下载大小";
|
||||
public const string HistoryUse = "拷贝该版本到StreamingAssets";
|
||||
public const string HistoryCopyToFolder = "导出该版本到文件夹";
|
||||
public const string Refresh = "刷新";
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/NBC/Asset/Editor/Defs/Language.cs.meta
Normal file
3
Assets/Scripts/NBC/Asset/Editor/Defs/Language.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 830b0a745cd84048b1ad857c814d2347
|
||||
timeCreated: 1679369094
|
||||
56
Assets/Scripts/NBC/Asset/Editor/Defs/Styles.cs
Normal file
56
Assets/Scripts/NBC/Asset/Editor/Defs/Styles.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NBC.Asset.Editor
|
||||
{
|
||||
public static class Styles
|
||||
{
|
||||
private static bool _init;
|
||||
private static GUISkin styleSheet;
|
||||
private static GUIStyle _headerBoxStyle;
|
||||
|
||||
public static string EditorGUIPath;
|
||||
public static Texture2D Package;
|
||||
public static Texture2D PackageLow;
|
||||
public static Texture2D Group;
|
||||
public static Texture2D Add;
|
||||
|
||||
public static GUIStyle headerBoxStyle => _headerBoxStyle != null
|
||||
? _headerBoxStyle
|
||||
: _headerBoxStyle = styleSheet.GetStyle("HeaderBox");
|
||||
|
||||
public static GUIStyle headerLabelStyle => _headerBoxStyle != null
|
||||
? _headerBoxStyle
|
||||
: _headerBoxStyle = styleSheet.GetStyle("HeaderLabel");
|
||||
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
string[] folders = { "Assets", "Packages" };
|
||||
var assets = AssetDatabase.FindAssets("t:texture icon_package", folders);
|
||||
if (assets.Length > 0)
|
||||
{
|
||||
var assetPath = AssetDatabase.GUIDToAssetPath(assets[0]);
|
||||
EditorGUIPath = Path.GetDirectoryName(assetPath)?.Replace('\\', '/');
|
||||
}
|
||||
|
||||
|
||||
styleSheet = LoadRes<GUISkin>("StyleSheet.guiskin");
|
||||
Package = LoadIcon("icon_package.png");
|
||||
PackageLow = LoadIcon("icon_package2.png");
|
||||
Group = LoadIcon("icon_folder.png");
|
||||
Add = LoadIcon("icon_add.png");
|
||||
}
|
||||
|
||||
static Texture2D LoadIcon(string filename)
|
||||
{
|
||||
return LoadRes<Texture2D>(filename);
|
||||
}
|
||||
|
||||
static T LoadRes<T>(string filename) where T : Object
|
||||
{
|
||||
return AssetDatabase.LoadMainAssetAtPath(EditorGUIPath + "/" + filename) as T;
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/NBC/Asset/Editor/Defs/Styles.cs.meta
Normal file
3
Assets/Scripts/NBC/Asset/Editor/Defs/Styles.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e719c6f260ec4447b6ec9e06eea4670c
|
||||
timeCreated: 1679380174
|
||||
Reference in New Issue
Block a user