Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progress #803

Open
MarcusGT076 opened this issue Jan 16, 2025 · 0 comments
Open

Progress #803

MarcusGT076 opened this issue Jan 16, 2025 · 0 comments
Assignees
Labels

Comments

@MarcusGT076
Copy link

MarcusGT076 commented Jan 16, 2025

Dear Khronos team,

i wanted to use the progress as a progression bar. The problem is that he calls onLoadComplete before the progress is finished. When he reaches 1% he starts to reference the loaded scene in the scene already. Did i use it in a wrong way ?
Would be nice if you can help. Here is my code snippet.

    private async Task LoadGltf()
    {
        progress = new Progress<ImportProgress>();
        progress.ProgressChanged += (sender, ev) => ShowProgress(ev);
        await sceneImporter.LoadSceneAsync(sceneIndex: 0, true, onLoadComplete: OnLoadComplete, progress:progress);
        await Task.Yield();
    }
    private void ShowProgress(ImportProgress ev)
    {
        Debug.Log("Progress is : " + ev.Progress * 100);
    }

Cheers,
Marcus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants