public void SizeFieldSlider() { var sliderSize = transform.GetChild(1).GetComponent <Slider>(); if (sliderSize == null) { throw new Exception("incorrect child index"); } int size = (int)sliderSize.value; sliderSize.interactable = false; // for dont trigger on arrow sliderSize.interactable = true; // for dont trigger on arrow CurrentField.DestroyField(); CurrentField.Init(size); sliderSize.transform.GetChild(0).GetComponent <Text>().text = "size field " + size.ToString(); }
public void SetTypeField() { var item = transform.GetChild(2).GetComponent <Dropdown>(); if (item == null) { throw new Exception("incorrect child index"); } var itemToggle = item.transform.GetChild(0).GetComponent <Toggle>(); if (itemToggle == null) { throw new Exception("incorrect child index"); } CurrentField.DestroyField(); int type = item.value; if (itemToggle.isOn) { type += 4; } CurrentField.Init((TypeField)type); }