//---------------------------------------------------------------------------- public void SetSumPanelView() { GameObject temp = m_uiTrans.Find(m_centerAnchorPath + "sumPanel/temp").gameObject; Transform parent = m_uiTrans.Find(m_centerAnchorPath + "sumPanel"); dictor = from objDic in mantissaNumberData.mantissaNumberDict orderby objDic.Value descending select objDic; int i = 0; foreach (var item in dictor) { GameObject obj = Object.Instantiate(temp, parent) as GameObject; obj.name = item.Key.ToString(); obj.transform.localScale = Vector3.one; obj.transform.localRotation = Quaternion.identity; i++; obj.transform.localPosition = temp.transform.localPosition + new Vector3(i * 100, 0, 0); SumTemp sumTemp = new SumTemp(obj, this, item.Key); m_SumTemp.Add(sumTemp); } Object.DestroyImmediate(temp); foreach (var item in dictor) { for (int j = 0; j < m_SumTemp.Count; j++) { if (m_SumTemp[j].type == item.Key) { m_SumTemp[j].SetView(item.Value); } } } }
//---------------------------------------------------------------------------- public bool GetUIObject() { if (m_objUI != null) { GameObject temp = m_uiTrans.Find(m_centerAnchorPath + "sumPanel/temp").gameObject; Transform parent = m_uiTrans.Find(m_centerAnchorPath + "sumPanel"); for (int i = 0; i <= MaxCount; i++) { GameObject obj = UnityEngine.Object.Instantiate(temp, parent) as GameObject; obj.name = i.ToString(); obj.transform.localScale = Vector3.one; obj.transform.localRotation = Quaternion.identity; obj.transform.localPosition = temp.transform.localPosition + new Vector3(i * 100, 0, 0); SumTemp sumTemp = new SumTemp(obj, this); m_SumTemp.Add(sumTemp); } UnityEngine.Object.DestroyImmediate(temp); m_inputField = GetUIComponent <InputField>(m_centerAnchorPath + "panel/inputField"); m_populatLab = GetUIComponent <Text>(m_centerAnchorPath + "panel/title2"); m_populatLab.text = string.Empty; afterLoopScrollView = GetUIComponent <LoopScrollerView>(m_centerAnchorPath + "afterFiltering/scrollView"); m_totalAfter = GetUIComponent <Text>(m_centerAnchorPath + "afterFiltering/after"); m_totalAfter.text = string.Empty; m_allToggle = GetUIComponent <Toggle>(m_centerAnchorPath + "selectGroup/all"); m_allToggle.onValueChanged.AddListener((bool isOn) => OnAllToggleChange(isOn)); m_clearToggle = GetUIComponent <Toggle>(m_centerAnchorPath + "selectGroup/clear"); m_clearToggle.onValueChanged.AddListener((bool isOn) => OnClearToggleChange(isOn)); m_normalToggle = GetUIComponent <Toggle>(m_centerAnchorPath + "selectGroup/normal"); m_normalToggle.onValueChanged.AddListener((bool isOn) => OnNormalToggleChange(isOn)); } return(true); }