Skip to content

Instantly share code, notes, and snippets.

Created November 10, 2020 00:21
What would you like to do?
Unity Cloud Build AutoIncrement
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
public class AutoIncrementVersion
public static void PreExport(UnityEngine.CloudBuild.BuildManifestObject manifest)
string buildNum = "unknown";
Debug.LogFormat($"PreExport:: PlayerSettings.WebGL.template = '{PlayerSettings.WebGL.template}'");
manifest.TryGetValue<string>("buildNumber", out buildNum);
Debug.LogFormat($"AutoIncrementVersion.PreExport() called, build number is {buildNum}");
string versionString = $"{Application.version}.{buildNum}";
Debug.LogFormat($"PlayerSettings.bundleVersion set to {versionString}");
PlayerSettings.bundleVersion = versionString;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment