Beispiel #1
0
 public override void OnNotify(string data, string component)
 {
     if (messegsEvent.Description().CompareTo("anticollisionSystem") == 0 && component.CompareTo("anticollisionChanged") == 0)
     {
         if (data.Contains("True"))
         {
             interactiveToggleScript.SetSelection(true);
         }
         else if (data.Contains("False"))
         {
             interactiveToggleScript.SetSelection(false);
         }
     }
     if (messegsEvent.Description().CompareTo("horizontalAC") == 0 && component.CompareTo("horizontalAnticollisionChanged") == 0)
     {
         if (data.Contains("True"))
         {
             interactiveToggleScript.SetSelection(true);
         }
         else if (data.Contains("False"))
         {
             interactiveToggleScript.SetSelection(false);
         }
     }
 }
 public override void OnNotify(string data, string component)
 {
     if (messegsEvent.Description().CompareTo("batteryVoltage") == 0 && component.CompareTo("batteryStateChanged") == 0)
     {
         json = JObject.Parse(data);
         var value = GetJArrayValue(json, "voltage");
         boxObj.GetComponent <TextMesh>().text = value + "V";
     }
     if (messegsEvent.Description().CompareTo("batteryTemperature") == 0 && component.CompareTo("batteryStateChanged") == 0)
     {
         json = JObject.Parse(data);
         var value = GetJArrayValue(json, "temperature");
         boxObj.GetComponent <TextMesh>().text = value + "C";
     }
     if (messegsEvent.Description().CompareTo("intelligentRTH") == 0 && component.CompareTo("smartRTHChanged") == 0)
     {
         if (data.Contains("True"))
         {
             interactiveToggleScript.SetSelection(true);
         }
         else if (data.Contains("False"))
         {
             interactiveToggleScript.SetSelection(false);
         }
     }
     if (messegsEvent.Description().CompareTo("batteryRTHPanel") == 0 && component.CompareTo("returnToHomeQuestionChanged") == 0)
     {
         boxObj.SetActive(true);
     }
 }
Beispiel #3
0
 public override void OnNotify(string data, string component)
 {
     if (messegsEvent.Description().CompareTo("beginnerMode") == 0 && component.CompareTo("beginnerModeChanged") == 0)
     {
         if (data.Contains("True"))
         {
             interactiveToggleScript.SetSelection(true);
         }
         else if (data.Contains("False"))
         {
             interactiveToggleScript.SetSelection(false);
         }
     }
     if (messegsEvent.Description().CompareTo("maximumAltitude") == 0)
     {
     }
     if (messegsEvent.Description().CompareTo("limitDistance") == 0 && component.CompareTo("limitDistanceChanged") == 0)
     {
         if (data.Contains("True"))
         {
             interactiveToggleScript.SetSelection(true);
         }
         else if (data.Contains("False"))
         {
             interactiveToggleScript.SetSelection(false);
         }
     }
     if (messegsEvent.Description().CompareTo("maximumFlightAltitude") == 0)
     {
     }
 }