ℹ️ Any custom updaters should be in an editor folder in the folder structure or in a editor ifdef.
If you want to know how to add a custom updater, see “How to make a custom build updater” in the documentation tab for more information on how to set these up!
ℹ️ Below is an example of a custom updater to update the build number in a game analytics settings asset when the number is updated by the asset & when the user manually sync’s the semantic version number.
using GameAnalyticsSDK;
using UnityEditor;
public class GameAnalyticsUpdater : IBuildUpdater, ISyncable
{
//
//
// IBuildUpdater Implementation
//
//
public int UpdateOrder => 10;
public void OnBuildVersionIncremented(BuildTarget buildTarget)
{
for (var i = 0; i < GameAnalytics.SettingsGA.Build.Count; i++)
{
GameAnalytics.SettingsGA.Build[i] = PlayerSettings.bundleVersion;
}
}
//
//
// ISyncable Implementation
//
//
public void OnVersionSync(string version)
{
for (var i = 0; i < GameAnalytics.SettingsGA.Build.Count; i++)
{
GameAnalytics.SettingsGA.Build[i] = version;
}
}
}