using YIUIFramework; using YooAsset; namespace ET.Client { [Invoke] public class YIUIInvokeYooAssetsHandler : AInvokeEntityHandler> { public override async ETTask Handle(Entity entity, YIUIInvokeEntity_LoadInitialize args) { EntityRef loadComponentRef = (YIUILoadComponent)entity; if (loadComponentRef.Entity == null) { Log.Error($"LoadComponent is null!"); return false; } return await loadComponentRef.Entity.AddComponent().Initialize(); } } [Invoke(EYIUIInvokeType.Sync)] public class YIUIInvokeGetAssetsInfoSyncHandler : AInvokeEntityHandler { public override AssetInfo Handle(Entity entity, YIUIInvokeEntity_GetAssetInfo args) { return entity.YIUILoad()?.GetComponent().GetAssetInfo(args.Location, args.AssetType); } } [Invoke(EYIUIInvokeType.Sync)] public class YIUIInvokeGetAssetInfoByGUIDSyncHandler : AInvokeEntityHandler { public override AssetInfo Handle(Entity entity, YIUIInvokeEntity_GetAssetInfoByGUID args) { return entity.YIUILoad()?.GetComponent().GetAssetInfoByGUID(args.AssetGUID, args.AssetType); } } }