private void OnTriggerStay(Collider other) { switch (other.gameObject.name) { case "SelectShape_F": if (CarInformation.Instance().IncreaseCradleY()) { Network_Controller_Tcp.Instance().SendBytes(Network_Encoder_Decoder.Instance().EncodeServoValue(Servo.ServoY, CarInformation.Instance().GetCradleY())); } break; case "SelectShape_R": if (CarInformation.Instance().DecreaseCradleX()) { Network_Controller_Tcp.Instance().SendBytes(Network_Encoder_Decoder.Instance().EncodeServoValue(Servo.ServoX, CarInformation.Instance().GetCradleX())); } break; case "SelectShape_L": if (CarInformation.Instance().IncreaseCradleX()) { Network_Controller_Tcp.Instance().SendBytes(Network_Encoder_Decoder.Instance().EncodeServoValue(Servo.ServoX, CarInformation.Instance().GetCradleX())); } break; case "SelectShape_B": if (CarInformation.Instance().DecreaseCradleY()) { Network_Controller_Tcp.Instance().SendBytes(Network_Encoder_Decoder.Instance().EncodeServoValue(Servo.ServoY, CarInformation.Instance().GetCradleY())); } break; } }
void OnTriggerExit(Collider other) { switch (other.gameObject.name) { case "SelectShape_F": _forward = false; break; case "SelectShape_L": _left = false; break; case "SelectShape_R": _right = false; break; case "SelectShape_B": _back = false; break; } if (!_forward && !_back && !_right && !_left) { Network_Controller_Tcp.Instance().SendBytes(Network_Encoder_Decoder.Instance().EncodeMovement(EnumMovementEncoder.Stop)); } }
void OnTriggerEnter(Collider other) { switch (other.gameObject.name) { case "SelectShape_F": Network_Controller_Tcp.Instance().SendBytes(Network_Encoder_Decoder.Instance().EncodeMovement(EnumMovementEncoder.Forward)); _forward = true; break; case "SelectShape_L": Network_Controller_Tcp.Instance().SendBytes(Network_Encoder_Decoder.Instance().EncodeMovement(EnumMovementEncoder.TurnLeft)); _left = true; break; case "SelectShape_R": Network_Controller_Tcp.Instance().SendBytes(Network_Encoder_Decoder.Instance().EncodeMovement(EnumMovementEncoder.TurnRight)); _right = true; break; case "SelectShape_B": Network_Controller_Tcp.Instance().SendBytes(Network_Encoder_Decoder.Instance().EncodeMovement(EnumMovementEncoder.Backward)); _back = true; break; } }
public void VoiceResponceSlower() { if (!CarInformation.Instance().DecreaseSpeed()) { return; } Network_Controller_Tcp.Instance().SendBytes(Network_Encoder_Decoder.Instance().EncodeSpeed(CarInformation.Instance().GetSpeed(), EnumEngine.EngineLeft)); Network_Controller_Tcp.Instance().SendBytes(Network_Encoder_Decoder.Instance().EncodeSpeed(CarInformation.Instance().GetSpeed(), EnumEngine.EngineRight)); _uiHolographicSpeesTxt.text = CarInformation.Instance().GetSpeed().ToString(); }
void Start() { if (!_socketReady) { return; } SendBytes(Network_Encoder_Decoder.Instance().EncodeSpeed(CarInformation.Instance().GetSpeed(), EnumEngine.EngineLeft)); SendBytes(Network_Encoder_Decoder.Instance().EncodeSpeed(CarInformation.Instance().GetSpeed(), EnumEngine.EngineRight)); ManagerObjects.Instance().GetObject(EnumObjects.UITxtSpeed).GetComponent <TextMesh>().text = CarInformation.Instance().GetSpeed().ToString(); SendBytes(Network_Encoder_Decoder.Instance().EncodeServoLock()); }
public void VoiceResponceLockCamera() { Network_Controller_Tcp.Instance().SendBytes(Network_Encoder_Decoder.Instance().EncodeServoLock()); CarInformation.Instance().InitCradle(); }
public void VoiceResponceChangeLight() { bool light = CarInformation.Instance().ChangeLight(); Network_Controller_Tcp.Instance().SendBytes(Network_Encoder_Decoder.Instance().EncodeLight(light)); }