TryRead
Reads bytes from a binary reader, validates the expected serialized version, and deserializes them into a new blob asset.
Read time 1 minuteLast updated 3 days ago
Definition
- Type: Method
- Namespace: Unity.Entities
- Assembly: UnityEngine.EntitiesModule
TryRead<T>(T, int, BlobAssetReference<T>)
Reads bytes from a binary reader, validates the expected serialized version, and deserializes them into a new blob asset.
public static bool TryRead<U>(U binaryReader, int version, out BlobAssetReference<T> result) where U : BinaryReader
Parameters
Expected version number of the blob data.
The resulting BlobAssetReference if the data was read successful.
Returns
Type | Description |
|---|---|
| bool | True if the data was successfully read, false otherwise |
TryRead(string, int, BlobAssetReference<T>)
Reads bytes from a fileName, validates the expected serialized version, and deserializes them into a new blob asset.
public static bool TryRead(string path, int version, out BlobAssetReference<T> result)
Parameters
The path of the blob data to read.
Expected version number of the blob data.
The resulting BlobAssetReference if the data was read successful.
Returns
Type | Description |
|---|---|
| bool | A bool if the read was successful or not. |