mirror of
https://github.com/game-ci/unity-builder.git
synced 2025-07-04 12:25:19 -04:00
33 lines
685 B
C#
33 lines
685 B
C#
using System;
|
|
using UnityEditor;
|
|
|
|
namespace UnityBuilderAction.Versioning
|
|
{
|
|
public class VersionApplicator
|
|
{
|
|
public static void SetVersion(string version)
|
|
{
|
|
if (version == "none") {
|
|
return;
|
|
}
|
|
|
|
Apply(version);
|
|
}
|
|
|
|
public static void SetAndroidVersionCode(string androidVersionCode) {
|
|
int bundleVersionCode = Int32.Parse(androidVersionCode);
|
|
if (bundleVersionCode <= 0) {
|
|
return;
|
|
}
|
|
|
|
PlayerSettings.Android.bundleVersionCode = bundleVersionCode;
|
|
}
|
|
|
|
static void Apply(string version)
|
|
{
|
|
PlayerSettings.bundleVersion = version;
|
|
PlayerSettings.macOS.buildNumber = version;
|
|
}
|
|
}
|
|
}
|