_assetref setunsafe (unstable buggy)

This commit is contained in:
2023-09-10 11:33:09 +03:00
parent 9f2016b619
commit 22132d550c
2 changed files with 62 additions and 4 deletions

View File

@@ -217,6 +217,17 @@ public:
{
OnSet(asset);
}
/// <summary>
/// Sets the asset reference without binding the events.
/// This should only be used cautiously in cases where the reference needs to be held for a short time (for example in while marshalling managed types).
/// </summary>
/// <param name="asset">The asset.</param>
void SetUnsafe(T* asset)
{
ASSERT(_asset == nullptr || asset == nullptr);
_asset = asset;
}
};
template<typename T>