public void TurnOnDevice(ActiveSensor sensor) { if (!isOn) { isOn = true; OnTurnedOn(this); } }
public void TurnOffDevice(ActiveSensor sensor) { if (isOn) { isOn = false; OnTurnedOff(this); } }
public KinectManager(IEventAggregator eventAggregator) { _eventAggregator = eventAggregator; KinectSensor.KinectSensors.StatusChanged += KinectSensorsOnStatusChanged; ActiveSensor.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30); ActiveSensor.DepthStream.Enable(DepthImageFormat.Resolution640x480Fps30); //ActiveSensor.ColorFrameReady += ActiveSensorOnColorFrameReady; ActiveSensor.DepthFrameReady += ActiveSensorOnDepthFrameReady; ActiveSensor.Start(); }
/// <summary> /// 使うセンサーの初期化 /// </summary> /// <param name="mode"></param> public void SettingSensors(ActiveSensor mode) { switch (mode) { //ジャイロセンサー case ActiveSensor.GYRO: //地磁気の無効化 Input.compass.enabled = false; //ジャイロセンサをサポートしていたら、ジャイロを有効化 Input.gyro.enabled = SystemInfo.supportsGyroscope; break; //地磁気+ジャイロ case ActiveSensor.GYROGEOMAG: //ジャイロセンサをサポートしていたら、ジャイロを有効化 Input.gyro.enabled = SystemInfo.supportsGyroscope; //地磁気の有効化 Input.compass.enabled = true; break; //デフォルト(地磁気センサー) case ActiveSensor.GEOMAG: default: //ジャイロセンサは無効化 Input.gyro.enabled = false; //地磁気の有効化 Input.compass.enabled = true; break; } //ジャイロが無効のままなら、地磁気モードへ変更 if (!Input.gyro.enabled) { Input.compass.enabled = true; mode = ActiveSensor.GEOMAG; } //使うセンサーのモードを指定 sensorMode = mode; }
public CollisionSensorEventArgs(ActiveSensor sensor, List <IEntity> entitiesInRange) : base(sensor) { EntitiesInRange = entitiesInRange; }