Class AssetOperationHandle
Assembly: YooAsset.dll
View Source
Declaration
public sealed class AssetOperationHandle : OperationHandleBase, IEnumerator, IDisposable
Properties
AssetObject
资源对象
View Source
Declaration
public Object AssetObject { get; }
Methods
WaitForAsyncComplete()
等待异步执行完毕
View Source
Declaration
public void WaitForAsyncComplete()
Release()
释放资源句柄
View Source
Declaration
public void Release()
Dispose()
释放资源句柄
View Source
Declaration
public void Dispose()
GetAssetObject<TAsset>()
获取资源对象
View Source
Declaration
public TAsset GetAssetObject<TAsset>() where TAsset : Object
Returns
<TAsset>
Type Parameters
Name | Description |
---|---|
TAsset | 资源类型 |
InstantiateSync()
同步初始化游戏对象
View Source
Declaration
public GameObject InstantiateSync()
Returns
UnityEngine.GameObject
InstantiateSync(Transform)
View Source
Declaration
public GameObject InstantiateSync(Transform parent)
Returns
UnityEngine.GameObject
Parameters
Type | Name |
---|---|
UnityEngine.Transform | parent |
InstantiateSync(Transform, bool)
View Source
Declaration
public GameObject InstantiateSync(Transform parent, bool worldPositionStays)
Returns
UnityEngine.GameObject
Parameters
Type | Name |
---|---|
UnityEngine.Transform | parent |
System.Boolean | worldPositionStays |
InstantiateSync(Vector3, Quaternion)
View Source
Declaration
public GameObject InstantiateSync(Vector3 position, Quaternion rotation)
Returns
UnityEngine.GameObject
Parameters
Type | Name |
---|---|
UnityEngine.Vector3 | position |
UnityEngine.Quaternion | rotation |
InstantiateSync(Vector3, Quaternion, Transform)
View Source
Declaration
public GameObject InstantiateSync(Vector3 position, Quaternion rotation, Transform parent)
Returns
UnityEngine.GameObject
Parameters
Type | Name |
---|---|
UnityEngine.Vector3 | position |
UnityEngine.Quaternion | rotation |
UnityEngine.Transform | parent |
InstantiateAsync()
异步初始化游戏对象
View Source
Declaration
public InstantiateOperation InstantiateAsync()
Returns
InstantiateAsync(Transform)
View Source
Declaration
public InstantiateOperation InstantiateAsync(Transform parent)
Returns
Parameters
Type | Name |
---|---|
UnityEngine.Transform | parent |
InstantiateAsync(Transform, bool)
View Source
Declaration
public InstantiateOperation InstantiateAsync(Transform parent, bool worldPositionStays)
Returns
Parameters
Type | Name |
---|---|
UnityEngine.Transform | parent |
System.Boolean | worldPositionStays |
InstantiateAsync(Vector3, Quaternion)
View Source
Declaration
public InstantiateOperation InstantiateAsync(Vector3 position, Quaternion rotation)
Returns
Parameters
Type | Name |
---|---|
UnityEngine.Vector3 | position |
UnityEngine.Quaternion | rotation |
InstantiateAsync(Vector3, Quaternion, Transform)
View Source
Declaration
public InstantiateOperation InstantiateAsync(Vector3 position, Quaternion rotation, Transform parent)
Returns
Parameters
Type | Name |
---|---|
UnityEngine.Vector3 | position |
UnityEngine.Quaternion | rotation |
UnityEngine.Transform | parent |
Events
Completed
完成委托
View Source
Declaration
public event Action<AssetOperationHandle> Completed
Event Type
System.Action<YooAsset.AssetOperationHandle>
Implements
System.Collections.IEnumerator
System.IDisposable