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

calling vue js function from unity #26

Closed
akbarism opened this issue Feb 2, 2021 · 3 comments
Closed

calling vue js function from unity #26

akbarism opened this issue Feb 2, 2021 · 3 comments

Comments

@akbarism
Copy link

akbarism commented Feb 2, 2021

can unity call the function in vue js?
so I have a case where when the game is finished, vue knows that and runs the function,

@KennyTech
Copy link

HELP DID YOU FIGURE IT OUT?

@votetake
Copy link
Owner

Documentation on Unity Portal WebGL: Interacting with browser scripting

TL;DR: anywhere in your application, you can declare functions that Unity will then call. Example declare on created or mounted methods and when call it from Unity

created() {
    window.gameFinished = function () {
        console.info('window.gameFinished');
    }
}

@votetake
Copy link
Owner

Or see @bondythegreat comment in a similar issue

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

No branches or pull requests

3 participants