public ViewModelBinding GetRoot() { if (parentBinding == null) { return(this); } return(parentBinding.GetRoot()); }
void Start() { viewModelBinding = GetComponentInParent <ViewModelBinding>(); if (viewModelBinding == null) { Debug.LogWarning("Hide view event binding failed! the viewModelBinding is null" + name); return; } viewModelBinding = viewModelBinding.GetRoot(); button = GetComponent <Button>(); button.onClick.AddListener(OnEventChanged); }