You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
2.1 KiB

using UnityEngine;
namespace ET
{
public class AutoResLoaderComponentAwakeSystem: AwakeSystem<AutoResLoaderComponent>
{
public override void Awake(AutoResLoaderComponent self)
{
self.Awake();
}
}
public class AutoResLoaderComponentDestroySystem: DestroySystem<AutoResLoaderComponent>
{
public override void Destroy(AutoResLoaderComponent self)
{
self.Destroy();
}
}
public static class AutoResLoaderComponentSystem
{
public static void Awake(this AutoResLoaderComponent self)
{
}
public static async ETTask<GameObject> InstantiateAsync(this AutoResLoaderComponent self, string location, Transform parent_transform = null,
bool stay_world_space = false)
{
var go = await YooAssetComponent.Instance.InstantiateAsyncAuto(self.GetHashCode(), location, parent_transform, stay_world_space);
return go;
}
public static GameObject InstantiateSync(this AutoResLoaderComponent self, string location, Transform parent_transform = null,
bool stay_world_space = false)
{
var go = YooAssetComponent.Instance.InstantiateSyncAuto(self.GetHashCode(), location, parent_transform, stay_world_space);
return go;
}
public static async ETTask<T> LoadAssetAsync<T>(this AutoResLoaderComponent self, string location) where T : UnityEngine.Object
{
var obj = await YooAssetComponent.Instance.LoadAssetAsyncAuto<T>(self.GetHashCode(), location);
return obj;
}
public static T LoadAssetSync<T>(this AutoResLoaderComponent self, string location) where T : UnityEngine.Object
{
var obj = YooAssetComponent.Instance.LoadAssetSyncAuto<T>(self.GetHashCode(), location);
return obj;
}
public static void Destroy(this AutoResLoaderComponent self)
{
YooAssetComponent.Instance.ReleaseAuto(self.GetHashCode());
}
}
}