| | |
| | |
|
| | | public static string auditOutTime = string.Empty;
|
| | |
|
| | | public static string SDK_PLUGIN_PROJECT
|
| | | {
|
| | | public static string SDK_PLUGIN_PROJECT {
|
| | | get { return LocalSave.GetString("SDK_PROJECT_PATH"); }
|
| | | set { LocalSave.SetString("SDK_PROJECT_PATH", value); }
|
| | | }
|
| | |
|
| | | public static bool obfuscatorEnabled
|
| | | {
|
| | | public static bool obfuscatorEnabled {
|
| | | get { return LocalSave.GetBool("obfuscatorEnabled", false); }
|
| | | set { LocalSave.SetBool("obfuscatorEnabled", value); }
|
| | | }
|
| | |
|
| | | public static int AssetPrior
|
| | | {
|
| | | public static int AssetPrior {
|
| | | get { return LocalSave.GetInt("HalfAssetPrior", 1); }
|
| | | set { LocalSave.SetInt("HalfAssetPrior", value); }
|
| | | }
|
| | |
| | | {
|
| | | Directory.CreateDirectory(directory);
|
| | | }
|
| | | #if UNITY_ANDROID
|
| | |
|
| | | var extension = Path.GetExtension(item.FullName);
|
| | | if (extension == ".meta")
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
|
| | | to = to + ".7z";
|
| | | SevenZipUtility.Compress(item.FullName, to);
|
| | | UnityEditor.EditorUtility.DisplayProgressBar("正在压缩资源", item.Name, (float)completeCount / totalCount);
|
| | | #elif UNITY_IOS
|
| | | File.Copy(item.FullName,to,true);
|
| | | #endif
|
| | | File.Copy(item.FullName, to, true);
|
| | | completeCount++;
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | Directory.CreateDirectory(directory);
|
| | | }
|
| | | #if UNITY_ANDROID
|
| | |
|
| | | var extension = Path.GetExtension(item.FullName);
|
| | | if (extension == ".meta")
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
|
| | | to = to + ".7z";
|
| | | SevenZipUtility.Compress(item.FullName, to);
|
| | | UnityEditor.EditorUtility.DisplayProgressBar("正在压缩资源", item.Name, (float)completeCount / totalCount);
|
| | | #elif UNITY_IOS
|
| | | File.Copy(item.FullName,to,true);
|
| | | #endif
|
| | | File.Copy(item.FullName, to, true);
|
| | | completeCount++;
|
| | | }
|
| | |
|
| | |
| | | var apkName = StringUtility.Contact(_output, "/", versionName, "_", versionConfig.clientPackageFlag, "_v", versionConfig.m_Version, "_", _buildIndex, ".apk");
|
| | | BuildPipeline.BuildPlayer(baseLevels, apkName, BuildTarget.Android, BuildOptions.None);
|
| | | }
|
| | |
|
| | | FileUtil.MoveFileOrDirectory(Application.dataPath + "/Scripts/PocoSDK",
|
| | | Application.dataPath + "/Editor/PocoSDK");
|
| | |
|
| | | var _content = File.ReadAllText(Application.dataPath + "/Scripts/Core/GameEngine/Login/Launch.cs");
|
| | | int _start = _content.IndexOf("// ## PocoManager Start") + "// ## PocoManager Start".Length;
|
| | | int _end = _content.IndexOf("// ## PocoManager End");
|
| | | var _front = _content.Substring(0, _start);
|
| | | var _back = _content.Substring(_end);
|
| | | _content = _front + "\r\n// ## PocoManager\r\n" + _back;
|
| | | File.WriteAllText(Application.dataPath + "/Scripts/Core/GameEngine/Login/Launch.cs", _content);
|
| | | }
|
| | |
|
| | | public static void BuildIpa(string _sdkPath, string _publisher, int _buildIndex, bool _replace)
|
| | |
| | | DateTime outTime;
|
| | | var correct = DateTime.TryParse(auditOutTime, out outTime);
|
| | | var directory = Application.dataPath + Path.DirectorySeparatorChar + "Resources/Config";
|
| | | if (Directory.Exists(directory))
|
| | | if (!Directory.Exists(directory))
|
| | | {
|
| | | Directory.CreateDirectory(directory);
|
| | | }
|
| | |
| | | EditorUtility.SetDirty(newVersionConfig);
|
| | |
|
| | | SetIconAndSplashImage(versionName);
|
| | | SetCreateRoleAnimation();
|
| | |
|
| | | PlayerSettings.companyName = "TheSecondWorld";
|
| | | PlayerSettings.productName = newVersionConfig.productName;
|
| | |
| | | PlayerSettings.allowedAutorotateToPortrait = false;
|
| | | PlayerSettings.allowedAutorotateToPortraitUpsideDown = false;
|
| | | PlayerSettings.bundleVersion = VersionConfig.GetVersionNumber(newVersionConfig.version).ToString();
|
| | |
|
| | | if (VersionConfig.Get().appId.Equals("test"))
|
| | | {
|
| | | if (Directory.Exists(Application.dataPath + "/Editor/PocoSDK")
|
| | | && !Directory.Exists(Application.dataPath + "/Scripts/PocoSDK"))
|
| | | {
|
| | | FileUtil.MoveFileOrDirectory(Application.dataPath + "/Editor/PocoSDK",
|
| | | Application.dataPath + "/Scripts/PocoSDK");
|
| | | }
|
| | |
|
| | | var _launchScript = File.ReadAllText(Application.dataPath + "/Scripts/Core/GameEngine/Login/Launch.cs");
|
| | | if (_launchScript != null)
|
| | | {
|
| | | if (_launchScript.IndexOf("// ## PocoManager") == -1)
|
| | | {
|
| | | Debug.LogError("找不到替代字符串");
|
| | | }
|
| | | else
|
| | | {
|
| | | _launchScript.Replace("// ## PocoManager",
|
| | | "if (VersionConfig.Get().appId.Equals(\"test\"))" +
|
| | | "{" +
|
| | | "SnxxzGame.Instance.gameObject.AddComponent<PocoManager>();" +
|
| | | "}");
|
| | |
|
| | | File.WriteAllText(Application.dataPath + "/Scripts/Core/GameEngine/Login/Launch.cs",
|
| | | _launchScript);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | CSObjectWrapEditor.Generator.ClearAll();
|
| | | CSObjectWrapEditor.Generator.GenAll();
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public static void SetCreateRoleAnimation()
|
| | | {
|
| | | var from = "Assets/Editor/Video/CreateRoleMovie.mp4";
|
| | | var to = "Assets/StreamingAssets/CreateRoleMovie.mp4";
|
| | |
|
| | | if (!Directory.Exists(Application.dataPath + "StreamingAssets"))
|
| | | {
|
| | | Directory.CreateDirectory(Application.dataPath + "StreamingAssets");
|
| | | }
|
| | |
|
| | | if (AssetDatabase.LoadAssetAtPath<UnityEngine.Video.VideoClip>(to) == null)
|
| | | {
|
| | | AssetDatabase.CopyAsset(from, to);
|
| | | }
|
| | | }
|
| | |
|
| | | static BuildTargetGroup GetBuildTarget()
|
| | | {
|
| | | #if UNITY_ANDROID
|