public void UpdateOrientations() { CustomDropdown orientationDropdown = OrientationsList.Dropdown; orientationDropdown.dropdownItems.Clear(); foreach (IO.Swagger.Model.NamedOrientation orientation in CurrentActionPoint.GetNamedOrientations()) { CustomDropdown.Item item = new CustomDropdown.Item { itemName = orientation.Name }; orientationDropdown.dropdownItems.Add(item); } if (orientationDropdown.dropdownItems.Count == 0) { OrientationsList.gameObject.SetActive(false); NoOrientation.gameObject.SetActive(true); UpdateOrientationBtn.interactable = false; } else { NoOrientation.gameObject.SetActive(false); OrientationsList.gameObject.SetActive(true); orientationDropdown.enabled = true; orientationDropdown.SetupDropdown(); UpdateOrientationBtn.interactable = true; } }
public void UpdateOrientationsDynamicList() { foreach (RectTransform o in OrientationsDynamicList.GetComponentsInChildren <RectTransform>()) { if (o.gameObject.tag != "Persistent") { Destroy(o.gameObject); } } foreach (IO.Swagger.Model.NamedOrientation orientation in CurrentActionPoint.GetNamedOrientations()) { CreateOrientationBtn(orientation); } UpdateOrientationsListLabel(); }