Ejemplo n.º 1
0
        private void UpdatePositionAndSizeLabels()
        {
            Vector3 anchorMax = m_anchorMaxEditor.GetValue();
            Vector3 anchorMin = m_anchorMinEditor.GetValue();

            if (RectTransformPropertyConverter.Approximately(anchorMin.x, anchorMax.x))
            {
                m_posXLabel.text  = m_lc.GetString("ID_RTEditor_CD_RectTransform_PosX");
                m_widthLabel.text = m_lc.GetString("ID_RTEditor_CD_RectTransform_Width");
            }
            else
            {
                m_posXLabel.text  = m_lc.GetString("ID_RTEditor_CD_RectTransform_Left");
                m_widthLabel.text = m_lc.GetString("ID_RTEditor_CD_RectTransform_Right");
            }

            if (RectTransformPropertyConverter.Approximately(anchorMin.y, anchorMax.y))
            {
                m_posYLabel.text   = m_lc.GetString("ID_RTEditor_CD_RectTransform_PosY");
                m_heightLabel.text = m_lc.GetString("ID_RTEditor_CD_RectTransform_Height");
            }
            else
            {
                m_posYLabel.text   = m_lc.GetString("ID_RTEditor_CD_RectTransform_Top");
                m_heightLabel.text = m_lc.GetString("ID_RTEditor_CD_RectTransform_Bottom");
            }

            m_posZLabel.text = m_lc.GetString("ID_RTEditor_CD_RectTransform_PosZ");
        }
Ejemplo n.º 2
0
 private object[] CreateConverters(ComponentEditor editor)
 {
     object[]    converters = new object[editor.Components.Length];
     Component[] components = editor.Components;
     for (int i = 0; i < components.Length; ++i)
     {
         RectTransform rt = (RectTransform)components[i];
         if (rt != null)
         {
             converters[i] = new RectTransformPropertyConverter
             {
                 RectTransform  = rt,
                 ExposeToEditor = rt.GetComponent <ExposeToEditor>()
             };
         }
     }
     return(converters);
 }
Ejemplo n.º 3
0
 private static bool Approximately(float a, float b)
 {
     return(RectTransformPropertyConverter.Approximately(a, b));
 }