1234567891011121314151617181920212223242526272829 |
- using UniFramework.Pooling;
- using UnityEngine;
- using YooAsset;
- namespace GFGGame
- {
- public static class AssetReleaserHelper
- {
- public static void AddReleaserToSpawnObj(GameObject gameObject, string resPath, SpawnHandle handle)
- {
- var assetReleaser = gameObject.GetComponent<AssetReleaser>();
- if (assetReleaser == null)
- {
- assetReleaser = gameObject.AddComponent<AssetReleaser>();
- }
- assetReleaser.SetSpawn(resPath, handle);
- }
- public static void AddReleaserToInstantiateObj(GameObject gameObject, string resPath, AssetOperationHandle handle)
- {
- AssetReleaser assetReleaser = gameObject.GetComponent<AssetReleaser>();
- if (assetReleaser == null)
- {
- assetReleaser = gameObject.AddComponent<AssetReleaser>();
- }
- assetReleaser.SetRes(resPath, handle);
- }
- }
- }
|