override public void OnGUI(Rect position, SerializedProperty property, GUIContent label) { EditorGUI.BeginProperty(position, label, property); string value = property.stringValue; value = EditorGUI.TextField(position, label, value); value = ProductInfo.CheckVersion(value); property.stringValue = value; EditorGUI.EndProperty(); }
/// <summary> /// Overrides the preprocess method to apply AndroidProductInfo to the PlayerSettings. /// <summary> override public void Preprocess() { base.Preprocess(); AndroidProductInfo info; info = PlatformUtil.GetSettings <AndroidProductInfo>(); #if !SAGO_BUILD_DO_NOT_USE_VERSION_SERVICE if (!VersionService.Bump(info)) { throw new System.InvalidOperationException("Could not bump build number."); } #endif if (info) { // store the player settings this.ProductName = PlayerSettings.productName; this.BuildTargetGroup = EditorUserBuildSettings.activeBuildTarget.ConvertToGroup(); this.BundleIdentifier = PlayerSettings.applicationIdentifier; this.BundleVersion = PlayerSettings.bundleVersion; this.BundleVersionCode = PlayerSettings.Android.bundleVersionCode; this.SdkVersion = PlayerSettings.Android.minSdkVersion; // copy product info to player settings PlayerSettings.productName = info.DisplayName; PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.Android, info.Identifier); PlayerSettings.bundleVersion = ProductInfo.CheckVersion(info.Version); PlayerSettings.Android.bundleVersionCode = ProductInfo.CheckBuild(info.Build); PlayerSettings.Android.minSdkVersion = (AndroidSdkVersions)info.SdkVersion; } #if !UNITY_CLOUD_BUILD && TEAMCITY_BUILD #if SAGO_ANDROID_USE_GRADLE_BUILD_SYSTEM EditorUserBuildSettings.androidBuildSystem = AndroidBuildSystem.Gradle; #else EditorUserBuildSettings.androidBuildSystem = AndroidBuildSystem.Internal; #endif #endif }