public override void Setup(HitChanceUISetupData setupData) { // null check if (!(thisIF = GetComponent <InputField>())) { throw new System.Exception($"AbsHitChanceIF.cs is not attached to an input field gameobject!"); } else { // Ensure proper setup data type if (setupData is IFSetupData) { thisIF.onEndEdit.AddListener(((IFSetupData)setupData).updateAction); thisIF.SetTextWithoutNotify(setupData.defaultValue + ""); } else { throw new System.Exception($"Setup failed - improper setup data type!"); } } }
public override void Setup(HitChanceUISetupData setupData) { // null check if (!(thisDropdown = GetComponent <Dropdown>())) { throw new System.Exception($"AbsHitChanceIF.cs is not attached to a dropdown gameobject!"); } else { // Ensure proper setup data type if (setupData is DDSetupData) { DDSetupData data = (DDSetupData)setupData; thisDropdown.onValueChanged.AddListener(data.updateAction); thisDropdown.AddOptions(data.options); thisDropdown.SetValueWithoutNotify(setupData.defaultValue); } else { throw new System.Exception($"Setup failed - improper setup data type!"); } } }
abstract public void Setup(HitChanceUISetupData setupData);