Skip to content

Communication From Unity on Quitted Fails #69

@Fallc

Description

@Fallc

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions