| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | //剔除表资源
|
| | | if (!includeConfig)
|
| | | {
|
| | |
| | |
|
| | | private static void PreBuild(string _publisher, int _buildIndex)
|
| | | {
|
| | | try
|
| | | var newVersionConfigPath = StringUtility.Contact("Assets/Resources/VersionConfig", ".asset");
|
| | | var versionName = string.Empty;
|
| | | var fromVersionConfig = GetVersionConfig(_publisher, out versionName);
|
| | | var newVersionConfig = ScriptableObject.CreateInstance<VersionConfig>();
|
| | | if (File.Exists(newVersionConfigPath))
|
| | | {
|
| | | var newVersionConfigPath = StringUtility.Contact("Assets/Resources/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 = _buildIndex;
|
| | |
|
| | | if (File.Exists(Application.dataPath + "/Resources/Game.txt"))
|
| | | {
|
| | | File.Delete(Application.dataPath + "/Resources/Game.txt");
|
| | | }
|
| | |
|
| | | File.WriteAllText(Application.dataPath + "/Resources/Game.txt", GetGameId(_publisher));
|
| | |
|
| | | AssetDatabase.CreateAsset(newVersionConfig, newVersionConfigPath);
|
| | | EditorUtility.SetDirty(newVersionConfig);
|
| | |
|
| | | SetIconAndSplashImage(versionName);
|
| | | //SetCreateRoleAnimation();
|
| | |
|
| | | 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 = VersionConfig.GetVersionNumber(newVersionConfig.version).ToString();
|
| | |
|
| | | if (GetBuildTarget() == BuildTargetGroup.Android)
|
| | | {
|
| | | CSObjectWrapEditor.Generator.ClearAll();
|
| | | CSObjectWrapEditor.Generator.GenAll();
|
| | | }
|
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | Debug.Log(ex);
|
| | | }
|
| | | finally
|
| | | {
|
| | | AssetDatabase.SaveAssets();
|
| | | AssetDatabase.Refresh();
|
| | | AssetDatabase.DeleteAsset(newVersionConfigPath);
|
| | | }
|
| | |
|
| | | VersionConfig.Copy(fromVersionConfig, newVersionConfig);
|
| | | newVersionConfig.buildTime = DateTime.Now.ToString("yy/MM/dd--HH:mm");
|
| | | newVersionConfig.buildIndex = _buildIndex;
|
| | |
|
| | | if (File.Exists(Application.dataPath + "/Resources/Game.txt"))
|
| | | {
|
| | | File.Delete(Application.dataPath + "/Resources/Game.txt");
|
| | | }
|
| | |
|
| | | File.WriteAllText(Application.dataPath + "/Resources/Game.txt", GetGameId(_publisher));
|
| | |
|
| | | AssetDatabase.CreateAsset(newVersionConfig, newVersionConfigPath);
|
| | | EditorUtility.SetDirty(newVersionConfig);
|
| | |
|
| | | SetIconAndSplashImage(versionName);
|
| | | //SetCreateRoleAnimation();
|
| | |
|
| | | 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 = VersionConfig.GetVersionNumber(newVersionConfig.version).ToString();
|
| | |
|
| | | if (GetBuildTarget() == BuildTargetGroup.Android)
|
| | | {
|
| | | CSObjectWrapEditor.Generator.ClearAll();
|
| | | CSObjectWrapEditor.Generator.GenAll();
|
| | | }
|
| | | //生成ILruntiemd CLR 绑定代码
|
| | | ILRuntimeCLRBinding.GenerateCLRBindingByAnalysis();
|
| | |
|
| | | AssetDatabase.SaveAssets();
|
| | | AssetDatabase.Refresh();
|
| | | }
|
| | |
|
| | | static VersionConfig GetVersionConfig(string _publisher, out string _versionName)
|