Теперь Addressables и UniTask в InstantiateAsync и прочих процессах
This commit is contained in:
1 parent
6b1f24b72e
commit
f940cbffe0
45 files changed
+811
-189
No files matched your search
@@ -1,6 +1,9 @@
|
||||
using System.Threading.Tasks;
|
||||
using Code.Configs;
|
||||
using Code.Constants;
|
||||
using UnityEngine;
|
||||
using Code.Constants;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
|
||||
namespace Code.StaticData
|
||||
{
|
||||
@@ -22,5 +25,10 @@ namespace Code.StaticData
|
||||
UIConfig = Resources.Load<UIConfig>(string.Format(StringPaths.ConfigSingle, "App", "UIConfig"));
|
||||
PlayerConfig = Resources.Load<PlayerConfig>(string.Format(StringPaths.ConfigSingle, "App", "PlayerConfig"));
|
||||
}
|
||||
|
||||
public async Task<T> InstantiateAsset<T>(AssetReference assetReference) where T : Behaviour
|
||||
{
|
||||
return (await Addressables.InstantiateAsync(assetReference).ToUniTask()).GetComponent<T>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user