Method WaitForObjectCompletion
WaitForObjectCompletion(UntypedWeakReferenceId, int)
Blocks on the main thread until the load operation completes. This function can be slow and so should be used carefully to avoid frame rate stuttering.
Declaration
[ExcludeFromBurstCompatTesting("References managed engine API and static data")]
public static bool WaitForObjectCompletion(UntypedWeakReferenceId objectId, int timeoutMs = 0)
Parameters
Type | Name | Description |
---|---|---|
UntypedWeakReferenceId | objectId | The id of the object to wait for. |
int | timeoutMs | The maximum time in milliseconds this function will wait before returning. Pass 0 to block indefinitely until completion. |
Returns
Type | Description |
---|---|
bool | Returns false if the timeout was reached before ContentFile completed loading or if the object is not loading. |
Exceptions
Type | Condition |
---|---|
Exception | An exception will be thrown if the internal file data is invalid. |