Ejemplo n.º 1
0
        public void Load(ModelEvents _me, Vector2 _v2Position, bool _bFuck = false)
        {
            for (int i = m_rtfMenuRoot.childCount - 1; i >= 0; i--)
            {
                Destroy(m_rtfMenuRoot.GetChild(i).gameObject);
            }

            m_rtfMenuRoot.anchoredPosition = _v2Position;

            foreach (ModelEventsType item in _me.m_list_events)
            {
                LoadButton(item);
            }

            foreach (ModelValueType item in _me.m_list_Values)
            {
                ModelEventsSlider.Load(item, m_rtfMenuRoot.transform);
            }
        }
        public static void Load(ModelValueType _mvt, Transform _tfRoot)
        {
            GameObject        v_go  = Instantiate(Resources.Load("RightMenuEvent/ModelEventsSlider"), _tfRoot) as GameObject;
            ModelEventsSlider v_mes = v_go.GetComponent <ModelEventsSlider>();

            v_mes.m_mvt             = _mvt;
            v_mes.m_slider.maxValue = _mvt.m_fMaxValue;
            v_mes.m_slider.minValue = _mvt.m_fMinValue;
            v_mes.m_slider.value    = _mvt.m_fValue;
            if (!_mvt.m_b真可调节否不可调节)
            {
                v_mes.m_slider.interactable = false;
            }

            if (v_mes.m_mvt.m_b真显示百分号否不显示百分号)
            {
                v_mes.m_text.text = v_mes.m_mvt.m_strValueName + (v_mes.m_slider.value * 100).ToString("f" + v_mes.m_mvt.m_n保留几位小数.ToString()) + "%";
            }
            else
            {
                v_mes.m_text.text = v_mes.m_mvt.m_strValueName + v_mes.m_slider.value.ToString("f" + v_mes.m_mvt.m_n保留几位小数.ToString());
            }
        }