private void CheckForBindableForm(bool force_bind_to_form = false) { if (!force_bind_to_form) { if (binded_form != null) { return; } if (!bind_automatically) { return; } } if (binded_form == null) { BindableForm bindable_form = gameObject.GetComponentInParent <BindableForm>(); binded_form = bindable_form; if (bindable_form == null) { return; } } Bind(binded_form); }
private void Unbind() { if (binded_form == null) { return; } binded_form.RemoveBinding(this); binded_form = null; }
private void Bind(BindableForm binded_form) { if (binded_form == null) { return; } this.binded_form = binded_form; binded_form.AddBinding(this); }