Keep local version of files

This commit is contained in:
2026-10-08 00:49:10 +05:30
parent 7fa0621ff8
commit 053665c690
7343 changed files with 5470578 additions and 5470528 deletions
+62 -62
View File
@@ -1,62 +1,62 @@
using System.Collections;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.ResourceManagement.ResourceProviders;
using UnityEngine.SceneManagement;
public static class AddressableSceneLoader
{
public const string IntroScene = "Intro";
public const string MainMenuScene = "MainMenu";
public const string GameScene = "Game";
public static void Load(string sceneName)
{
AddressableSceneLoadRunner.Instance.Begin(sceneName);
}
public static IEnumerator LoadRoutine(string sceneName)
{
AsyncOperationHandle<SceneInstance> handle = Addressables.LoadSceneAsync(sceneName, LoadSceneMode.Single);
yield return handle;
if (handle.Status != AsyncOperationStatus.Succeeded)
Debug.LogError("Failed to load addressable scene '" + sceneName + "': " + handle.OperationException);
}
}
public class AddressableSceneLoadRunner : MonoBehaviour
{
static AddressableSceneLoadRunner instance;
public static AddressableSceneLoadRunner Instance
{
get
{
if (instance != null)
return instance;
var go = new GameObject(nameof(AddressableSceneLoadRunner));
DontDestroyOnLoad(go);
instance = go.AddComponent<AddressableSceneLoadRunner>();
return instance;
}
}
void Awake()
{
if (instance != null && instance != this)
{
Destroy(gameObject);
return;
}
instance = this;
DontDestroyOnLoad(gameObject);
}
public void Begin(string sceneName)
{
StartCoroutine(AddressableSceneLoader.LoadRoutine(sceneName));
}
}
using System.Collections;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.ResourceManagement.ResourceProviders;
using UnityEngine.SceneManagement;
public static class AddressableSceneLoader
{
public const string IntroScene = "Intro";
public const string MainMenuScene = "MainMenu";
public const string GameScene = "Game";
public static void Load(string sceneName)
{
AddressableSceneLoadRunner.Instance.Begin(sceneName);
}
public static IEnumerator LoadRoutine(string sceneName)
{
AsyncOperationHandle<SceneInstance> handle = Addressables.LoadSceneAsync(sceneName, LoadSceneMode.Single);
yield return handle;
if (handle.Status != AsyncOperationStatus.Succeeded)
Debug.LogError("Failed to load addressable scene '" + sceneName + "': " + handle.OperationException);
}
}
public class AddressableSceneLoadRunner : MonoBehaviour
{
static AddressableSceneLoadRunner instance;
public static AddressableSceneLoadRunner Instance
{
get
{
if (instance != null)
return instance;
var go = new GameObject(nameof(AddressableSceneLoadRunner));
DontDestroyOnLoad(go);
instance = go.AddComponent<AddressableSceneLoadRunner>();
return instance;
}
}
void Awake()
{
if (instance != null && instance != this)
{
Destroy(gameObject);
return;
}
instance = this;
DontDestroyOnLoad(gameObject);
}
public void Begin(string sceneName)
{
StartCoroutine(AddressableSceneLoader.LoadRoutine(sceneName));
}
}