/// <summary> /// Open the configurations for an existing ultrasonic sensor or add a new ultrasonic sensor /// </summary> /// <param name="i"></param> public void OnUltrasonicDropdownClicked(int i) { if (i == 0) { return; } if (i - 1 == numUltrasonics) //Add button { List <GameObject> updatedList = sensorManagerGUI.AddUltrasonic(); UpdateSensorDropdown(ultrasonicDropdown, updatedList); numUltrasonics++; if (PlayerPrefs.GetInt("analytics") == 1) { Analytics.CustomEvent("Added Ultrasonic Sensor", new Dictionary <string, object> //for analytics tracking { }); } } else //Edit one of the existing sensors { sensorManagerGUI.SetUltrasonicAsCurrent(i - 1); sensorManagerGUI.StartConfiguration(); } ultrasonicDropdown.value = 0; }
/// <summary> /// Open the configurations for an existing ultrasonic sensor or add a new ultrasonic sensor /// </summary> /// <param name="i"></param> public void OnUltrasonicDropdownValueChanged(int i) { if (i == 0) { return; } if (i - 1 == numUltrasonics) //Add button { List <GameObject> updatedList = sensorManagerGUI.AddUltrasonic(); UpdateSensorDropdown(ultrasonicDropdown, updatedList); numUltrasonics++; AnalyticsManager.GlobalInstance.LogEventAsync(AnalyticsLedger.EventCatagory.SensorTab, AnalyticsLedger.EventAction.Added, "Ultrasonic", AnalyticsLedger.getMilliseconds().ToString()); } else //Edit one of the existing sensors { sensorManagerGUI.SetUltrasonicAsCurrent(i - 1); sensorManagerGUI.StartConfiguration(); AnalyticsManager.GlobalInstance.LogEventAsync(AnalyticsLedger.EventCatagory.SensorTab, AnalyticsLedger.EventAction.Edited, "Ultrasonic", AnalyticsLedger.getMilliseconds().ToString()); } ultrasonicDropdown.value = 0; AnalyticsManager.GlobalInstance.LogEventAsync(AnalyticsLedger.EventCatagory.SensorTab, AnalyticsLedger.EventAction.Clicked, "Dropdown - Ultrasonic", AnalyticsLedger.getMilliseconds().ToString()); }