Hello, trying to get some information with regards to integrating a progress loading screen using wrapper class. Please what exactly are we suppose to do in the wrapper script/class? Are we suppose to query ork game state(whether a scene is loading)? am not really a coder, am just trying to get some information i can give to someone that will assist me
My last thread here has some clues: http://forum.orkframework.com/discussion/4545/unity-wrapper#latest
I'm personally trying to get this working myself with an asset called Loading Screen Pro.
I made a wrapper based on Gil's input that got the loader to work using the below settings/code...
However, ORK instantiates the player in the loading screen scene instead of the actual ORK scene that follows it. So, it's not working yet. I contacted the creator of the asset and he gave me some tips that didn't work. He also made another version of his script especially for ORK and it still doesn't work.
So, not sure at this point where to go with this.
The dev from Loading Screen Pro sent me a script based on Gil's last suggestion but it had an error. His next revised version didn't get attached to his email, so hoping he sends me something later that might work.
Changing the location of the SceneManager.sceneLoaded -= ORK.Core.OnSceneLoaded; and SceneManager.sceneLoaded += ORK.Core.OnSceneLoaded;does seem to partially work, halting the spawning of the player inside any loading scene, but it still doesn't spawn in the actual ORK game scene.
From what I've seen, pretty much all of the other loading screen solutions use this dedicated loading scene approach if they're anything beyond a progress bar using the UI canvas.
What's the other dev's asset you contacted?
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public static class LoadWrapper {
public static void LoadScene(string sceneName, LoadSceneMode mode)
{
SceneManager.sceneLoaded -= ORK.Core.OnSceneLoaded;
LoadingScreenPro.LoadScene(sceneName);
SceneManager.sceneLoaded += ORK.Core.OnSceneLoaded;
}
public static void LoadSceneAsync(string sceneName, LoadSceneMode mode)
{
SceneManager.sceneLoaded -= ORK.Core.OnSceneLoaded;
LoadingScreenPro.LoadScene(sceneName);
SceneManager.sceneLoaded += ORK.Core.OnSceneLoaded;
}
}
I think were the problem could be, is how to get the target scene name and pass it to LoadingScreenPro.LoadScene() as parameter. @gamingislove is there any ork method we can use to get the target scene name(with return type string)?
Changing the location did seem to partially halt the player spawning inside the loader as I said but still didn't spawn the player in the proper scene.
I guess registering to the scene loaded functionality is made too soon, so you could try delaying it using this function:
private static IEnumerator DelayRegister()
{
yield return null;
SceneManager.sceneLoaded += ORK.Core.OnSceneLoaded;
}
Call the function in the LoadScene and LoadSceneAsync functions instead of registering:
ORK.StartCoroutine(DelayRegister());
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!