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}"; } } }
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); }
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)); }
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 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!"); }