WuhuIslandTesting/Library/PackageCache/com.unity.addressables@1.21.12/Tests/Editor/DocExampleCode/ScriptReference/UsingBuildPath.cs
2025-01-07 02:06:59 +01:00

24 lines
686 B
C#

namespace AddressableAssets.DocExampleCode
{
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.AddressableAssets.Initialization;
internal class UsingBuildPath
{
#region GET_SETTINGS_FROM_BUILDPATH
public string GetBuiltContentAddressablesVersion()
{
string settingsPath = Addressables.BuildPath + "/settings.json";
if (System.IO.File.Exists(settingsPath))
{
string json = System.IO.File.ReadAllText(settingsPath);
ResourceManagerRuntimeData activeRuntimeSettings =
JsonUtility.FromJson<ResourceManagerRuntimeData>(json);
return activeRuntimeSettings.AddressablesVersion;
}
return null;
}
#endregion
}
}