private void UpdateActivePage() { int num = 0; for (int i = 0; i < this.m_PlantsElements.Count; i++) { PageNum component = this.m_PlantsElements[i].GetComponent <PageNum>(); NotepadData component2 = this.m_PlantsElements[i].gameObject.GetComponent <NotepadData>(); if (component.m_PageNum == this.m_CurrentPage && (component2 == null || component2.ShouldShow())) { this.m_PlantsElements[i].SetActive(true); if (component2 != null) { component2.m_WasActive = true; } this.UpdateSubElements(this.m_PlantsElements[i].transform); num++; } else { this.m_PlantsElements[i].SetActive(false); } } this.m_NumActiveElementsOnPage = num; }
public override bool ShouldShowNoEntries() { for (int i = 0; i < this.m_ItemsElelements.Count; i++) { NotepadData component = this.m_ItemsElelements[i].gameObject.GetComponent <NotepadData>(); if (component == null || component.ShouldShow()) { return(false); } } return(true); }
public override int GetNewEntriesCount() { int num = 0; for (int i = 0; i < this.m_PlantsElements.Count; i++) { NotepadData component = this.m_PlantsElements[i].gameObject.GetComponent <NotepadData>(); if (component != null && component.ShouldShow() && !component.m_WasActive) { num++; } } return(num); }
private void UpdateSubElements(Transform trans) { for (int i = 0; i < trans.childCount; i++) { Transform child = trans.GetChild(i); NotepadData component = child.GetComponent <NotepadData>(); if (component == null || component.ShouldShow()) { child.gameObject.SetActive(true); } else { child.gameObject.SetActive(false); } } }
private void SetupElement(NotepadData data, ref bool right_page, ref float shift_y, float height_scale, ref int num_elems, int num_elems_in_page) { if (data.ShouldShow()) { data.gameObject.SetActive(true); if (data.gameObject.transform.childCount > 0) { RectTransform component = data.gameObject.transform.GetChild(0).gameObject.GetComponent <RectTransform>(); if (component) { Vector3 v = component.anchoredPosition; v.x = (right_page ? this.m_RightDummyPosition.x : this.m_LeftDummyPosition.x); v.y = (right_page ? this.m_RightDummyPosition.y : this.m_LeftDummyPosition.y); v.y += shift_y; v.z = this.m_LeftDummyPosition.z; component.anchoredPosition = v; shift_y -= 7f; num_elems++; if (num_elems >= num_elems_in_page) { if (!right_page) { shift_y = 0f; } right_page = true; } } } if (data != null) { data.m_WasActive = true; if (StoryObjectivesManager.Get().IsStoryObjectiveCompleted(data.name)) { this.StrikeThroughChildren(data.gameObject.transform); return; } } } else { data.gameObject.SetActive(false); } }