Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
版本:V0.0.8
描述:获取电子陀螺仪数据,支持VTZN的WIFI版本、蓝牙5.0版本
TestGame 是示例场景,场景中挂在TestGame.cs脚本
在TestGame.cs脚本中注意添加以下部分
this.SendEvent(new DeviceManagerEvent() { deviceType = _deviceType });
语句中,deviceType为输入的硬件类型
发送事件后,获取设备管理器,此时分为两种情况:
3.1 主动控制骑马机,即_deviceType = DeviceType.HorseControl时,使用
horseControlManager = this.GetUtility<IHorseControlManager>();
horseControlManager.Init(HorseIP);
HorseIP:主动控制骑马机的IP地址
3.2 其他设备,即非主动控制骑马机时,使用
deviceManager = this.GetUtility<IDeviceManager>();
deviceManager.Init(GyroSensorType.BLE);
GyroSensorType.BLE:蓝牙传感器
使用方式
4.1 主动控制骑马机使用时,需要连接WiFi
WiFi名:Horse230725
WiFi密码:0123456789
4.2 非主动控制骑马机设备使用时
deviceManager.logState += DeviceManager_LogState;
deviceManager.connectedState += DeviceManager_ConnectedState;