azesmway / react-native-unity-play

Play an unity view in react native
MIT License
40 stars 16 forks source link

Passing parameters into the unity project #1

Closed Betapig1 closed 3 years ago

Betapig1 commented 3 years ago

Is this package able to take in parameters to use in the unity project? Like let's say I needed a number to be put in from react native to unity, is that a thing the package is capable of doing?

azesmway commented 3 years ago

In the current version, I did not enable such a feature, I just needed to play the unity project. If this is required for you, I will do it in the next version.

Betapig1 commented 3 years ago

It is required for me yes. Would this be able to be added somewhat quickly?

azesmway commented 3 years ago

It is required for me yes. Would this be able to be added somewhat quickly?

I make for IOS ( I can not test ) See the last commit

Using

import { UnityResponderView } from 'react-native-unity-play';
UnityResponderView.postMessage(gameObject, functionName, message)