Beispiel #1
0
    private IEnumerator WaitSceneLoading(SceneTypeEnum sceneTypeTo, CustomObject customObject, Action action)
    {
        var isLoaded = _loadOperation.isDone;

        while (isLoaded == false)
        {
            yield return(new WaitForEndOfFrame());

            isLoaded = _loadOperation.isDone;
        }

        //Dirty code
        var    sceneAttachedScripts = UnityEngine.Object.FindObjectOfType <BaseScene>();
        IScene sceneTo = sceneAttachedScripts;

        sceneTo.SetDependencies(sceneTypeTo, this);

        sceneTo.Activate();
        action.Invoke();
    }