Code: Select all
public void LoadPEPScene()
{
LoaderGameManager.Instance.LoadSpecificPEPScene(19);
}
[Tooltip("Typically leave unticked so temporary Dialogue Managers don't unregister your functions.")]
public bool unregisterOnDisable = false;
void OnEnable()
{
Lua.RegisterFunction(nameof(LoadPEPScene), this, SymbolExtensions.GetMethodInfo(() => LoadPEPScene()));
}
void OnDisable()
{
if (unregisterOnDisable)
{
Lua.UnregisterFunction(nameof(LoadPEPScene));
}
}
Code: Select all
public void LoadSpecificPEPScene(int sceneLoadIndex)
{
backgroundImage.sprite = backgrounds[Random.Range(0, backgrounds.Length)];
loadingScreen.SetActive(true);
StartCoroutine(WaitTime());
StartCoroutine(GenerateTip());
sceneLoading.Add(SceneManager.UnloadSceneAsync((int)SceneIndexes.TownOfBeginning));
sceneLoading.Add(SceneManager.UnloadSceneAsync((int)SceneIndexes.InventorySystemUI));
sceneLoading.Add(SceneManager.LoadSceneAsync(sceneLoadIndex, LoadSceneMode.Additive));
StartCoroutine(GetSceneLoadProgress());
}
LoaderGameManager.Instance.LoadSpecificPEPScene(19);
How should I proceed with this for this to work?