#if UNITY_EDITOR using UnityEditor; #endif using UnityEngine; namespace XRTool.Util { /// /// public Version(int major, int minor, int build, int revision); /// public enum BuildVersion { /// /// 主要 /// Major = 0, /// /// 次要 /// Minor = 1, /// /// 构建版本 /// Build = 2 ///// ///// 补丁版本,修订 ///// //revision = 3, } /// /// 发布模式 /// 主要根据此模式,来做对应的处理,例如debug模式下,会输出全部日志 /// 测试模式下,会输出error和异常。测试模式下可以调出相关的指令,但是输出更多的设置内容 /// release是正式发布版本,不会输出日志。同时提升系统性能 /// debug,test,release /// public enum BuildType { /// /// 日志模式,可以记录用户日志 /// Debug = 0, /// /// 测试版本,程序自测版本,拥有更多的操控权限 /// Test = 1, /// /// 商用版本 /// Release = 2 } /// /// 资源的读取方式Editor LocalEditor /// public enum AssetsType { /// /// Resource加载,仅支持Resource路径下的资源加载 /// 其他模式为了后续支持AssetBundle资源加载 /// Resource = -2, /// /// 编辑器模式下,读取编辑器Asset下资源 /// Editor = -1, /// /// 编辑器模式下读取指定路径的打包后的资源 /// LocalEditor = 0, /// /// 真机运行下读取游戏路径下的资源 /// LocalPhone = 1, /// /// 真机运行下读取指定路径下的资源 /// App = 2, /// /// 读取StreamingAsset路径下资源 /// Stream = 3 } /// /// 编译的平台 /// 在打包的时候要选择对应的平台 /// public enum BuildPlatform { /// /// PC版本 /// StandaloneWindows = 0, /// /// IOS版本 /// iOS = 1, /// /// 安卓版本 /// Android = 2 } /// /// 播放模式 /// public enum PlayType { /// /// 电脑模式,PC端运行 /// PC = 0, /// /// VR模式,VR头盔 /// VRGlass = 1, /// /// AR模式,AR眼睛 /// ARGlass = 2, /// /// 移动手机模式,触屏操作 /// Mobile = 3 } public class BuildConfig : ScriptableObject { public static BuildConfig Instance; /// /// 发布模式,debug release /// [Tooltip("发布模式")] public BuildType buildType; /// /// 资源访问方式LocalEditor APP /// [Tooltip("资源访问方式")] public AssetsType assetsType; /// /// 发布的平台 BuildTarget IOS Android /// #if UNITY_EDITOR [Tooltip("发布的平台")] public BuildTarget buildTarget; #endif /// /// 运行的模式Normal AR /// [Tooltip("运行的模式")] public PlayType playType; [Tooltip("APP发布时间")] public string buildTime; [Tooltip("APP版本号")] public string appVersion; public string otherSymbol = "TRILIB_USE_ZIP"; /// /// 版本类型,修订版,补丁版 /// [Tooltip("版本类型")] public BuildVersion buildVersion = BuildVersion.Build; public string languagePath = "Language"; public string artInfoPath = "ArtInfo"; public string prefix = "T"; public bool useHand = false; public string UserPath; public string LocalPath; public string appProName = "MRStore"; public string appPackName = "com.shadowcreate.MRStore"; private string serverUrl1 ="";// "http://file.shadowcreator.com/10001/file/2295"; public string ServerUrl { get => serverUrl1; set => serverUrl1 = value; } #if UNITY_EDITOR public BuildTargetGroup buildTargetGroup = BuildTargetGroup.Standalone; [MenuItem("Assets/Create/BuildConfig", false, 0)] static void CreateDynamicConf() { Object obj = Selection.activeObject; if (obj) { string path = AssetDatabase.GetAssetPath(obj); BuildConfig bullet = CreateInstance(); if (bullet) { string confName = UnityUtil.TryGetName(path); AssetDatabase.CreateAsset(bullet, confName); Instance = bullet; } else { Debug.Log(typeof(BuildConfig) + " is null"); } } } #endif } }