unity2018与Androidstudio互相发送及接受消息
因为最近经常要与安卓端交互,自己记录一下。举个栗子。
1.Androidstudio方面,调用unity带参数方法BarCodeData
unity端:
Androidstudio端:使用
UnityPlayer.UnitySendMessage,第一个参数是unity当前所挂脚本object名字,第二个是参数是方法名字,第三个参数是要传入的数据
2.在unity方面,调用安卓端GetBarCode方法。
安卓端:
unity端