When building sometimes the .plist file was missing the Universal SDK properties. The root of the problem is in UniversalSDKSettings.cs because this property is used by PlistUpdating.cs:
public static UniversalSDKSettings Instance
{
get
{
if (ReferenceEquals(instance, null))
{
// this can not find the settings object in the Assets/Editor/UniversalSDK folder
instance = Resources.Load(settingsAssetName) as UniversalSDKSettings;
if (ReferenceEquals(instance, null))
{
// as a fallback here a temporary object is created
instance = CreateInstance<UniversalSDKSettings>();
}
}
return instance;
}
}
Why does it sometimes work? Because opening the settings object in the inspector updates the temporary instance in UniversalSDKSettingsEditor.cs:
Moving the Settings from Assets/Editor/UniversalSDK to Assets/Editor/UniversalSDK/Resources fixes the problem. Now Resources.Load() can find the settings asset.
Also the folder creation got a slight rework which is still not ideal but a bit more robust I think.
Problem Description
When building sometimes the .plist file was missing the Universal SDK properties. The root of the problem is in UniversalSDKSettings.cs because this property is used by PlistUpdating.cs:
Why does it sometimes work? Because opening the settings object in the inspector updates the temporary instance in UniversalSDKSettingsEditor.cs:
Fix Description
Moving the Settings from Assets/Editor/UniversalSDK to Assets/Editor/UniversalSDK/Resources fixes the problem. Now Resources.Load() can find the settings asset.
Also the folder creation got a slight rework which is still not ideal but a bit more robust I think.