question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Communication From Unity on Quitted Fails

See original GitHub issue

I tried to invoke a function inside React after Unity has quitted, but it doesn’t seem to trigger the function.

In my console, it correctly logs that the application has quitted.

Bildschirmfoto 2019-06-25 um 17 03 26

However, the function or the console.log() specified in the callback never gets triggered.

constructor(props) {
        super(props);

        // Next up create a new Unity Content object to 
        // initialise and define your WebGL build. The 
        // paths are relative from your index file.

        this.unityContent = new UnityContent(
            "/Blocks/Build.json",
            "/Blocks/UnityLoader.js"
        );

        // this.unityContent.on("finishBlocksFromUnity", () => {
        //     this.props.toNewWords();
        // });

        this.unityContent.on("quitted", () => {

            // Now we can for example go back to another page
            console.log("Log quitted")
            this.props.toNewWords();
        });
    }

The Unity application gets quitted with Application.Quit();.

Did I miss something?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
colinschoencommented, May 22, 2020

Sounds good. That is what I ended up doing and all is working well. Thanks for the tip.

0reactions
github-actions[bot]commented, Jul 19, 2021

This issue was closed because it has been inactive for 30 days since being marked as stale.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Communication From Unity on Quitted Fails · Issue #69
I tried to invoke a function inside React after Unity has quitted, but it doesn't seem to trigger the function.
Read more >
Unity locks up, can't force quit, must restart often.
Same problem for me when hit play unity stuck and cannot closed by force quit. I have to restart. Version 2019.3.2f1. How can...
Read more >
Should YOU QUIT Unity FOREVER? - YouTube
We'll look at the most recent Unity news and decide whether to stay with Unity. Looking to the future, all the controversy and...
Read more >
Communicating with Events in Unity - YouTube
Check out the Course: https://bit.ly/3i7lLtH-------Use Events or a PubSub model to communicate between gameobjects that have no reference to ...
Read more >
DiRT restore quitted.
I ran DbWalker v4.0.17 on the Japanese Win2K box without error and DiRT backup v1.0.115 to copy Unity configuration into the 3rd box....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found