public void WrapperForValidation() { if (targetText == null) { targetText = GetComponentInParent <TextWithEvents> (); } if (targetText.charsIdForClass.ContainsKey(name)) { DoStateTransition(interactable ? SelectionState.Normal : SelectionState.Disabled, true); } }
//it must be Start due to fact that TextWithEvents must prepare some infos (on Awake) before button //it could be done with script execution order though if u need change this void Start() { targetText = GetComponentInParent <TextWithEvents> (); }