private void SetProSetting(CeliaBuildOption option) { // 应用名 string productName = CeliaBuilder.GetInputParam("ProductName:", option.Args); PlayerSettings.productName = string.IsNullOrEmpty(productName) ? "少女的王座" : productName; // 公司名 string companyName = CeliaBuilder.GetInputParam("CompanyName:", option.Args); PlayerSettings.companyName = string.IsNullOrEmpty(companyName) ? "Rastar Games Inc." : companyName; // 默认包名 PlayerSettings.SetApplicationIdentifier(option.PlayerOption.targetGroup, "com.xlycs.rastar"); // ==构建平台== option.PlayerOption.target = option.ProcessCfg.Target; option.PlayerOption.targetGroup = BuildPipeline.GetBuildTargetGroup(option.PlayerOption.target); // 强制使用OPENGL ES3 PlayerSettings.SetGraphicsAPIs(option.PlayerOption.target, new GraphicsDeviceType[] { GraphicsDeviceType.Vulkan, GraphicsDeviceType.OpenGLES3 }); // ScriptingRuntimeVersion PlayerSettings.scriptingRuntimeVersion = ScriptingRuntimeVersion.Latest; PlayerSettings.SetScriptingBackend(option.PlayerOption.targetGroup, ScriptingImplementation.IL2CPP); bool isBetaVersion = option.ReleaseLevel == ReleaseLevel.Beta; // 设置Il2CppCompilerConfiguration Il2CppCompilerConfiguration il2CppCfg = isBetaVersion ? Il2CppCompilerConfiguration.Release : Il2CppCompilerConfiguration.Debug; PlayerSettings.SetIl2CppCompilerConfiguration(option.PlayerOption.targetGroup, il2CppCfg); }
public override void PreExcute(CeliaBuildOption option) { bool isBetaVersion = option.ReleaseLevel == ReleaseLevel.Beta; // 设置PlayerOption.options option.PlayerOption.options = isBetaVersion ? BuildOptions.None : (BuildOptions.AllowDebugging | BuildOptions.Development | BuildOptions.ConnectWithProfiler | BuildOptions.AllowDebugging); if (option.OutputProject) { option.PlayerOption.options |= BuildOptions.AcceptExternalModificationsToPlayer; } if (option.SDKType == SDKType.Native) { PlayerSettings.Android.minSdkVersion = AndroidSdkVersions.AndroidApiLevel21; PlayerSettings.Android.targetSdkVersion = AndroidSdkVersions.AndroidApiLevel28; } else { PlayerSettings.Android.minSdkVersion = AndroidSdkVersions.AndroidApiLevel23; } PlayerSettings.Android.forceSDCardPermission = true; PlayerSettings.Android.targetArchitectures = AndroidArchitecture.ARMv7 | AndroidArchitecture.ARM64; //google审核需要targetSdkVersion不小于29 但是打包机版本不全可能有问题 //PlayerSettings.Android.targetSdkVersion = AndroidSdkVersions.AndroidApiLevelAuto; EditorUserBuildSettings.androidCreateSymbolsZip = true; //Debug.Log("-SetAndroidOption--PlayerSettings.Android.targetSdkVersion--->" + PlayerSettings.Android.targetSdkVersion.ToString()); //Debug.Log("SetAndroidOption PreExcuted!"); }
private void SetOutputPath(CeliaBuildOption option) { string outputPath = CeliaBuilder.GetInputParam("Path:", option.Args); EditorUserBuildSettings.exportAsGoogleAndroidProject = option.OutputProject; // iOS不能成包 if (option.OutputProject || option.ProcessCfg.Target == UnityEditor.BuildTarget.iOS) { if (!string.IsNullOrEmpty(outputPath)) { option.PlayerOption.locationPathName = outputPath; } else { option.PlayerOption.locationPathName = $"Outputs/{option.ProcessCfg.Target}/{CeliaBuilder.ApkName}_Project"; } } else { string suffix = option.ProcessCfg.Target == UnityEditor.BuildTarget.Android ? ".apk" : ""; if (!string.IsNullOrEmpty(outputPath)) { option.PlayerOption.locationPathName = $"{outputPath}{suffix}"; } else { option.PlayerOption.locationPathName = $"Outputs/{option.ProcessCfg.Target}/{CeliaBuilder.ApkName}{suffix}"; } } }
/// <summary> /// 从args读取生成打包配置 /// </summary> public static bool GenerateBuildOtions(string[] args = null) { buildOption = new CeliaBuildOption(); buildOption.PlayerOption = new BuildPlayerOptions(); buildOption.Args = args == null?Environment.GetCommandLineArgs() : args; string platformName = GetInputParam("Platform:", buildOption.Args); buildOption.ProcessCfg = AssetDatabase.LoadAssetAtPath <ProcessCfg>($"Assets/Editor/CeliaBuilder/{platformName}.asset"); string projectValue = GetInputParam("Project:", buildOption.Args); bool.TryParse(projectValue, out buildOption.OutputProject); string levelName = GetInputParam("Level:", buildOption.Args); Enum.TryParse(levelName, out buildOption.ReleaseLevel); string sdkName = GetInputParam("SDK:", buildOption.Args); Enum.TryParse(sdkName, out buildOption.SDKType); Console.WriteLine($"Target:{buildOption.ProcessCfg.Target} Project:{buildOption.OutputProject} Release:{buildOption.ReleaseLevel}"); return(true); }
public override void PostExcute(CeliaBuildOption option) { #if UNITY_EDITOR_OSX switch (option.SDKType) { case SDKType.None: SetNoneSDKProjectSetting(); break; case SDKType.Native: SetNativeSDK(); break; case SDKType.NativeChukai: SetNativeChukaiSDK(); break; case SDKType.Oversea: SetOverseaSDK(GetSDKParams(option)); break; case SDKType.CeliaOversea: SetCeliaOverseaSDK(); break; } // 复原文件夹 SetSDKFolderBack(); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); Debug.Log("SetIOSSDK PostExcuted!"); #endif }
public override void PreExcute(CeliaBuildOption option) { PlayerSettings.iOS.scriptCallOptimization = ScriptCallOptimizationLevel.SlowAndSafe; if (option.ReleaseLevel == ReleaseLevel.Alpha) { option.PlayerOption.options = BuildOptions.AllowDebugging | BuildOptions.Development | BuildOptions.ConnectWithProfiler | BuildOptions.AllowDebugging; } else { option.PlayerOption.options = BuildOptions.None; } PlayerSettings.iOS.hideHomeButton = false; PlayerSettings.iOS.deferSystemGesturesMode = UnityEngine.iOS.SystemGestureDeferMode.BottomEdge; PlayerSettings.iOS.allowHTTPDownload = true; PlayerSettings.iOS.targetDevice = iOSTargetDevice.iPhoneAndiPad; PlayerSettings.iOS.sdkVersion = iOSSdkVersion.DeviceSDK; PlayerSettings.iOS.appleEnableAutomaticSigning = false; PlayerSettings.iOS.iOSManualProvisioningProfileType = ProvisioningProfileType.Automatic; PlayerSettings.accelerometerFrequency = 60; if (option.SDKType == SDKType.CeliaOversea) { PlayerSettings.iOS.targetOSVersionString = "10.0"; } else if (option.SDKType == SDKType.Native) {//星辉SDK要求 PlayerSettings.iOS.targetOSVersionString = "11.0"; } Debug.Log("SetIOSOption PreExcuted!"); }
public override void PostExcute(CeliaBuildOption option) { // 复原文件夹 SetSDKFolderBack(); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); Debug.Log("SetAndroidSDK PostExcuted!"); }
private void SetDefineSymbols(CeliaBuildOption option) { string newDefines = "HOTFIX_ENABLE;AOT"; if (option.ReleaseLevel == ReleaseLevel.Beta) { newDefines += ";CELIA_RELEASE"; } PlayerSettings.SetScriptingDefineSymbolsForGroup(buildTargetGroup, newDefines); }
public override void PostExcute(CeliaBuildOption option) { GameSetting.gi.ip = ip; GameSetting.gi.port = port; EditorUtility.SetDirty(GameSetting.gi); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); Debug.Log("SetServerSetting PostExcuted!"); }
public override void PostExcute(CeliaBuildOption option) { //var storyResPathSettings = Resources.Load<StoryResPathSettings>("ScriptableObjects/GameStory/StoryResPathSettings"); //storyResPathSettings.isEiditor = recordIsStoryInEditor; //storyResPathSettings.wechatDebug = recordIsWechatDebug; //EditorUtility.SetDirty(storyResPathSettings); //AssetDatabase.SaveAssets(); //AssetDatabase.Refresh(); //Debug.Log("SetStoryResPath PostExcuted!"); }
public override void PreExcute(CeliaBuildOption option) { group = BuildPipeline.GetBuildTargetGroup(option.ProcessCfg.Target); recordDefines = PlayerSettings.GetScriptingDefineSymbolsForGroup(group); string newDefines = recordDefines; newDefines = "HOTFIX_ENABLE;AOT"; if (option.ReleaseLevel == ReleaseLevel.Beta) { newDefines += ";CELIA_RELEASE"; } PlayerSettings.SetScriptingDefineSymbolsForGroup(group, newDefines); }
private JObject GetSDKParams(CeliaBuildOption option) { string fileName = CeliaBuilder.GetInputParam("SDKParams:", option.Args); if (string.IsNullOrEmpty(fileName)) { return(null); } string jsonStr = File.ReadAllText(Path.Combine(Application.dataPath.Replace("Assets", ""), "BuildSettings", "SDKParams", fileName + ".json")); return(JObject.Parse(jsonStr)); }
public override void PreExcute(CeliaBuildOption option) { if (File.Exists(logo1_Path)) { } buildTargetGroup = BuildPipeline.GetBuildTargetGroup(option.ProcessCfg.Target); SetProSetting(option); SetDefineSymbols(option); SetSplash(option); SetOutputPath(option); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); Debug.Log("SetProjectSetting PreExcuted!"); }
private PlistElementDict GetSDKSign(CeliaBuildOption option) { string fileName = CeliaBuilder.GetInputParam("Sign:", option.Args); if (string.IsNullOrEmpty(fileName)) { return(null); } PlistDocument plist = new PlistDocument(); plist.ReadFromFile(Path.Combine(Application.dataPath.Replace("Assets", ""), "BuildSettings", "IOSSignature", fileName + ".plist")); return(plist.root); }
private void SetSplash(CeliaBuildOption option) { // 关闭Unity自带的Splash PlayerSettings.SplashScreen.show = true; PlayerSettings.SplashScreen.showUnityLogo = false; if (option.SDKType == SDKType.Native) { SetLogos(true); SetStaticSplash(false); } else { SetLogos(false); SetStaticSplash(true); } }
public override void PreExcute(CeliaBuildOption option) { celiaBuildOption = option; PlayerSettings.SplashScreen.show = true; PlayerSettings.SplashScreen.showUnityLogo = false; if (celiaBuildOption.SDKType == SDKType.Native) { SetLogos(true); SetStaticSplash(false); } else { SetLogos(false); SetStaticSplash(true); } }
public override void PreExcute(CeliaBuildOption option) { try { //if (GameStoryInspector.CheckeGameStoryContainError()) //{ // GameStoryInspector.UpdateGameStory(); //} //if (GameStoryInspector.CheckeGameStoryContainError()) //{ // Debug.Log("GameStory剧情文件已经损坏"); //} } catch (System.Exception) { throw; } }
private JObject GetSDKParams(CeliaBuildOption option) { string fileName = CeliaBuilder.GetInputParam("SDKParams:", option.Args); if (string.IsNullOrEmpty(fileName)) { if (option.SDKType == SDKType.None) { return(null); } else { throw new System.Exception($"SetAndroidSDK ERROR: Not Set SDKParams for SDK{option.SDKType}!"); } } string jsonStr = File.ReadAllText(Path.Combine(Application.dataPath.Replace("Assets", ""), "BuildSettings", "SDKParams", fileName + ".json")); return(JObject.Parse(jsonStr)); }
public override void PreExcute(CeliaBuildOption option) { ip = GameSetting.gi.ip; port = GameSetting.gi.port; string serverName = CeliaBuilder.GetInputParam("SV:", option.Args); switch (serverName) { case "rel": ReleaseServer(); break; case "rel_175": Release175Server(); break; case "rev": ReviewServer(); break; case "seven": GameTestServer(); break; case "dev": DevelopServer(); break; default: // 未指定服务器时,使用当前项目服务器 DefaultSetting(); break; } EditorUtility.SetDirty(GameSetting.gi); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); Debug.Log("SetServerSetting PreExcuted!"); }
public override void PreExcute(CeliaBuildOption option) { this.option = option; pluginIOSPath = Application.dataPath + "/Plugins/iOS"; pluginSavePath = Application.dataPath + "/Plugins/PlatformSDK/"; #if UNITY_EDITOR_OSX PlistElementDict signCfg = GetSDKSign(option); JObject sdkParams = GetSDKParams(option); SetSDKFolderBack(); SetIOSSign(signCfg); SetSDKFolder(option.SDKType); SetSDKInfo(sdkParams, option.SDKType); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); #endif Debug.Log("SetIOSSDK PreExcuted!"); }
public override void PreExcute(CeliaBuildOption option) { this.option = option; pluginAndroidPath = Application.dataPath + "/Plugins/Android"; pluginSavePath = Application.dataPath + "/Plugins/PlatformSDK/"; JObject signCfg = GetSDKSign(option); JObject sdkParams = GetSDKParams(option); //先清空 SetSDKFolderBack(); SetAndroidSign(signCfg); SetSDKFolder(option.SDKType); SetSDKInfo(option.SDKType, sdkParams); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); Debug.Log("SetAndroidSDK PreExcuted!"); }
public override void PostExcute(CeliaBuildOption option) { //PlayerSettings.SetScriptingDefineSymbolsForGroup(group, recordDefines); }
public override void PreExcute(CeliaBuildOption option) { //EditorScript.EncryptData(); }
public override void PostExcute(CeliaBuildOption option) { PlayerSettings.Android.useAPKExpansionFiles = false; //Debug.Log("SetAndroidOption PostExcuted!"); }
public override void PostExcute(CeliaBuildOption option) { }
public override void PreExcute(CeliaBuildOption option) { option.PlayerOption.scenes = ProcessScenes().ToArray(); Debug.Log("SetScenes PreExcuted!"); }
public override void PostExcute(CeliaBuildOption option) { Debug.Log("SetScenes PostExcuted!"); }
public override void PostExcute(CeliaBuildOption option) { Debug.Log("SetOutputPath PostExcute!"); }
public override void PostExcute(CeliaBuildOption option) { Debug.Log("SetProjectSetting PostExcuted!"); }
public virtual void PreExcute(CeliaBuildOption option) { }