// Token: 0x06002A1E RID: 10782 RVA: 0x00467A10 File Offset: 0x00465C10 private PanelObject AddContentObj(int btnID, GameObject item, Vector2 pos, float height, GameObject content) { RectTransform component = item.GetComponent <RectTransform>(); if (component != null) { GameObject gameObject = UnityEngine.Object.Instantiate(item) as GameObject; if (gameObject != null) { RectTransform component2 = gameObject.GetComponent <RectTransform>(); ScrollPanelItem component3 = gameObject.GetComponent <ScrollPanelItem>(); if (component2 != null && component3 != null) { component3.m_BtnID1 = btnID; component3.m_Handler = this; component2.anchoredPosition = pos; component2.anchorMax = new Vector2(0f, 1f); component2.anchorMin = new Vector2(0f, 1f); component2.pivot = new Vector2(0f, 1f); component2.sizeDelta = new Vector2(component.sizeDelta.x, component.sizeDelta.y); PanelObject panelObject = new PanelObject(); panelObject.gameObject = gameObject; panelObject.rectTransform = component2; gameObject.transform.SetParent(content.transform, false); return(panelObject); } } } return(null); }
// Update is called once per frame void Update() { if (Input.GetMouseButtonDown(0)) { po = FindPanelObject(); if (po != null) { po.OnDown(); } } if (Input.GetMouseButton(0)) { if (po != null) { po.OnHold(); } } if (Input.GetMouseButtonUp(0)) { if (po != null) { po.OnUp(); po = null; } } }
//Hides all menu panels from being displayed public void HideAllPanels() { foreach (GameObject PanelObject in MenuPanelObjects) { PanelObject.SetActive(false); } }
public void UpdatePanel() { if (!initialized) { Init(); } is_empty = true; int current = 0; // Debug.Log("Updating list panel " + this.name + "\n"); if (panel_type == PanelType.Circle || dynamic_spacing) { current_buttons = 0; for (int i = 0; i < list.Count; i++) { PanelObject l = list[i]; if (l.do_not_display) { continue; } if (l != null && l.gameObject.activeSelf) { current_buttons++; } } if (current_buttons == 0) { setBackground(true, 0); return; } // Debug.Log("List Panel has " + current_buttons + "\n"); } for (int i = 0; i < list.Count; i++) { PanelObject l = list[i]; if (l.do_not_display) { continue; } if (l != null && l.gameObject.activeSelf) { Vector3 pos = getPosition(i, current); transforms[i].anchoredPosition = pos; current++; } } if (current > 0) { is_empty = false; } setBackground(is_empty, current); }
// Token: 0x06002A27 RID: 10791 RVA: 0x00468248 File Offset: 0x00466448 private void CreatePanelObjects(out PanelObject[] m_PanelObjects, int Max) { m_PanelObjects = new PanelObject[this.m_MaxItemOfPage]; for (int i = 0; i < this.m_MaxItemOfPage; i++) { Vector2 pos = new Vector2(this.m_Border, 0f); m_PanelObjects[i] = this.AddContentObj(-1, this.m_customItem, pos, 0f, this.m_Content); this.m_LastIdx = i; } }
public void ResetOrder() { Canvas[] cans = PanelObject.GetComponentsInChildren <Canvas>(); for (int i = 0, count = cans.Length; i < count; ++i) { cans[i].sortingOrder = cans[i].sortingOrder - order; } ParticleSystem[] ps = PanelObject.GetComponentsInChildren <ParticleSystem>(); for (int j = 0, length = ps.Length; j < length; ++j) { Renderer[] renders = ps[j].GetComponentsInChildren <Renderer>(); for (int k = 0, size = renders.Length; k < size; ++k) { renders[k].sortingOrder = renders[k].sortingOrder - order; } } order = 0; }
public void AddLabel(PanelObject l, bool setparent, bool update) { if (!l.do_not_display) { if (setparent) { l.transform.SetParent(transform); l.transform.localScale = Vector3.one; l.transform.localRotation = Quaternion.identity; list.Add(l); } l.SetPanel(this); transforms.Add(l.GetComponent <RectTransform>()); if (update) { UpdatePanel(); } } l.InitButton(); }
public override void ShowPanel() { PanelObject.SetActive(true); }