public void Awake() { buttonClickListener = GetComponent <ButtonClickListener>(); Transform transform = GetComponentInParent <MainNavStateHandler>().transform; mainNavButtons = transform.GetComponentsInChildren <MainNavButton>(includeInactive: true); CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>(); DataEntityHandle entityByType = cPDataEntityCollection.GetEntityByType <MainNavData>(); mainNavData = cPDataEntityCollection.GetComponent <MainNavData>(entityByType); mainNavData.OnCurrentStateChanged += onCurrentStateChanged; }
public void Awake() { TitleParent.SetActive(value: true); CloseButtonParent.SetActive(value: true); CPDataEntityCollection cPDataEntityCollection = Service.Get <CPDataEntityCollection>(); DataEntityHandle entityByType = cPDataEntityCollection.GetEntityByType <MainNavData>(); mainNavData = cPDataEntityCollection.GetComponent <MainNavData>(entityByType); layoutElement = GetComponent <LayoutElement>(); if (layoutElement != null) { defaultLayoutElementHeight = layoutElement.preferredHeight; } }