| | |
| | | public static readonly string versionsFilePath = Application.dataPath + Path.DirectorySeparatorChar + "Editor/VersionConfigs/Versions.txt"; |
| | | public static readonly string[] baseLevels = new string[] { "Assets/Resources/Scenes/Launch.unity", "Assets/Resources/Scenes/Empty.unity" };
|
| | |
|
| | | 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); }
|
| | | } |
| | | |
| | | static string ANDROID_PLUGIN_PATH = Application.dataPath + "/Plugins/Android"; |
| | | |
| | | static int packageIndex
|
| | | {
|
| | | static int packageIndex {
|
| | | get { return LocalSave.GetInt("ClientPackageIndex", 1); }
|
| | | set { LocalSave.SetInt("ClientPackageIndex", value); }
|
| | | } |
| | | |
| | | public static void BuildPublishers ( string _sdkPath, string _assetBundlePath, string _output, string _publisherString, bool _development, bool _replace)
|
| | | public static void BuildPublishers(string _sdkPath, string _assetBundlePath, string _output, string _publisherString, bool _development, bool _replace)
|
| | | {
|
| | | var publisherIds = new List<string>();
|
| | | var tempStrings = _publisherString.Split(StringUtility.splitSeparator, StringSplitOptions.RemoveEmptyEntries);
|
| | |
| | | for (int i = 0; i < smallPackages.Count; i++)
|
| | | {
|
| | | #if UNITY_ANDROID
|
| | | BuildApk(_sdkPath,_output, smallPackages[i], _development);
|
| | | BuildApk(_sdkPath, _output, smallPackages[i], _development);
|
| | | #elif UNITY_IOS
|
| | | BuildIpa(smallPackages[i], _replace);
|
| | | #endif
|
| | |
| | | |
| | | private static void PreBuild(string _publisher)
|
| | | {
|
| | | var newVersionConfigPath = StringUtility.Contact("Assets/Resources/ScriptableObject/Config/VersionConfig", ".asset");
|
| | | var versionName = string.Empty;
|
| | | var fromVersionConfig = GetVersionConfig(_publisher, out versionName);
|
| | | var newVersionConfig = ScriptableObject.CreateInstance<VersionConfig>();
|
| | | if (File.Exists(newVersionConfigPath))
|
| | | try
|
| | | {
|
| | | AssetDatabase.DeleteAsset(newVersionConfigPath);
|
| | | var newVersionConfigPath = StringUtility.Contact("Assets/Resources/ScriptableObject/Config/VersionConfig", ".asset");
|
| | | var versionName = string.Empty;
|
| | | var fromVersionConfig = GetVersionConfig(_publisher, out versionName);
|
| | | var newVersionConfig = ScriptableObject.CreateInstance<VersionConfig>();
|
| | | if (File.Exists(newVersionConfigPath))
|
| | | {
|
| | | AssetDatabase.DeleteAsset(newVersionConfigPath);
|
| | | }
|
| | |
|
| | | VersionConfig.Copy(fromVersionConfig, newVersionConfig);
|
| | | newVersionConfig.buildTime = DateTime.Now.ToString("yy/MM/dd--HH:mm");
|
| | | newVersionConfig.buildIndex = packageIndex;
|
| | |
|
| | | AssetDatabase.CreateAsset(newVersionConfig, newVersionConfigPath);
|
| | | EditorUtility.SetDirty(newVersionConfig);
|
| | |
|
| | | SetIconAndSplashImage(versionName);
|
| | |
|
| | | PlayerSettings.companyName = "TheSecondWorld";
|
| | | PlayerSettings.productName = newVersionConfig.productName;
|
| | | PlayerSettings.applicationIdentifier = newVersionConfig.bundleIdentifier;
|
| | | PlayerSettings.defaultInterfaceOrientation = UIOrientation.AutoRotation;
|
| | | PlayerSettings.allowedAutorotateToLandscapeLeft = true;
|
| | | PlayerSettings.allowedAutorotateToLandscapeRight = true;
|
| | | PlayerSettings.allowedAutorotateToPortrait = false;
|
| | | PlayerSettings.allowedAutorotateToPortraitUpsideDown = false;
|
| | | PlayerSettings.bundleVersion = newVersionConfig.version;
|
| | |
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | Debug.Log(ex);
|
| | | }
|
| | | finally
|
| | | {
|
| | | AssetDatabase.SaveAssets();
|
| | | AssetDatabase.Refresh();
|
| | | }
|
| | |
|
| | | VersionConfig.Copy(fromVersionConfig, newVersionConfig);
|
| | | newVersionConfig.buildTime = DateTime.Now.ToString("yy/MM/dd--HH:mm");
|
| | | newVersionConfig.buildIndex = packageIndex;
|
| | |
|
| | | AssetDatabase.CreateAsset(newVersionConfig, newVersionConfigPath);
|
| | | EditorUtility.SetDirty(newVersionConfig);
|
| | |
|
| | | SetIconAndSplashImage(versionName);
|
| | |
|
| | | PlayerSettings.companyName = "TheSecondWorld";
|
| | | PlayerSettings.productName = newVersionConfig.productName;
|
| | | PlayerSettings.applicationIdentifier = newVersionConfig.bundleIdentifier;
|
| | | PlayerSettings.defaultInterfaceOrientation = UIOrientation.AutoRotation;
|
| | | PlayerSettings.allowedAutorotateToLandscapeLeft = true;
|
| | | PlayerSettings.allowedAutorotateToLandscapeRight = true;
|
| | | PlayerSettings.allowedAutorotateToPortrait = false;
|
| | | PlayerSettings.allowedAutorotateToPortraitUpsideDown = false;
|
| | | PlayerSettings.bundleVersion = newVersionConfig.version;
|
| | |
|
| | | AssetDatabase.SaveAssets();
|
| | | AssetDatabase.Refresh();
|
| | | } |
| | | |
| | | static VersionConfig GetVersionConfig(string _publisher, out string _versionName)
|