Развитие гоночек

This commit is contained in:
ThomasCharester committed 2026-02-06 10:30:50 +03:00
1 parent ec60c47652
commit b54083521f
532 files changed
+16091 -28231

No files matched your search

@@ -4,9 +4,9 @@ using Code.Infrastructure.Configs;
using Code.Infrastructure.EventBus;
using Code.Infrastructure.Generators;
using Cysharp.Threading.Tasks;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.ResourceManagement.ResourceProviders;
using UnityEngine.SceneManagement;
namespace Code.Infrastructure.SceneLoader
@@ -37,15 +37,19 @@ namespace Code.Infrastructure.SceneLoader
// TODO типилище
public async UniTaskVoid LoadSceneAsync(SceneId id, LoadSceneMode loadMode)
{
await Addressables.LoadSceneAsync(_sceneInfos[id].SceneAsset, loadMode);
_loadedScenes.Add(id,Addressables.LoadSceneAsync(_sceneInfos[id].SceneAsset, loadMode));
await _loadedScenes[id];
_scenesActions[id]();
}
private Dictionary<SceneId, AsyncOperationHandle<SceneInstance>> _loadedScenes = new();
public Scene GetScene(SceneId id) => _loadedScenes[id].Result.Scene;
public async UniTaskVoid UnloadSceneAsync(SceneId id)
{
// TODO НЕВОЗМОЖНО ВЫГРУЗИТЬ БЛЯДСКИЕ СЦЕНЫ
// await Addressables.UnloadSceneAsync(_sceneInfos[])
await Addressables.UnloadSceneAsync(_loadedScenes[id]);
_loadedScenes.Remove(id);
}
private AsyncOperationHandle<IList<SceneInfoConfig>> _configHandle;