In the process of integrating Addressables, I found some small issues. I think reporting each of them with a bug report is too wasteful, so I posted here. If dev team needs a bug report for a specific issue, I can submit it.
-
The ‘Dispose’ method is not called for ‘webReq’ in RequestOperation_completed of TextDataProvider.InternalOp
-
SceneOp.Update is called twice each frame during scene loading
class SceneOp
{
protected override void Execute()
{
// ...
if (!m_DepOp.IsValid() || m_DepOp.OperationException == null)
{
m_Inst = InternalLoadScene(m_Location, loadingFromBundle, m_LoadSceneParameters, m_ActivateOnLoad, m_Priority);
((IUpdateReceiver)this).Update(0.0f);
if (!IsDone)
m_ResourceManager.AddUpdateReceiver(this); <------
}
// ...
}
}
class AsyncOperationBase<TObject>
{
internal void InvokeExecute()
{
Execute();
HasExecuted = true;
IUpdateReceiver upOp = this as IUpdateReceiver;
if (upOp != null)
m_UpdateCallbacks.Add(m_UpdateCallback); <------
}
}
- SceneOp.Update may be called after scene is loaded and never be removed
- If SceneOp completes in SceneOp.Execute, it will still be added to m_UpdateCallbacks in AsyncOperationBase.InvokeExecute
- In CleanBundleCacheOperation.Execute, when cache is not ready, it should return immediately
protected override void Execute()
{
// ...
if (!Caching.ready)
CompleteInternal(false, false, "Cache is not ready to be accessed."); <------
// ...
}
- In DisableAssetImportOnBuild sample, the calling order of AssetDatabase.StopAssetEditing and AssetDatabase.StartAssetEditing should be reversed.
- Documentation: Unity - Scripting API: AssetDatabase.StartAssetEditing
- In SerializationUtilities.WriteObjectToByteList, there are two code blocks to process typeof(int):
if (objectType == typeof(Int32))
{
byte[] tmp = BitConverter.GetBytes((Int32)obj);
buffer.Add((byte)ObjectType.Int32);
buffer.AddRange(tmp);
return tmp.Length + 1;
}
if (objectType == typeof(int))
{
byte[] tmp = BitConverter.GetBytes((UInt32)obj);
buffer.Add((byte)ObjectType.UInt32);
buffer.AddRange(tmp);
return tmp.Length + 1;
}