void ResizePanel()
    {
        if (m_UIPanel == null)
        {
            m_UIPanel = GetComponent("UIPanel");
        }

        if (m_UIPanel != null)
        {
            // UIRoot
            object uiRoot = SSReflection.GetPropValue(m_UIPanel, "root");

            // Get Size
            float h = (float)(int)SSReflection.GetPropValue(uiRoot, "activeHeight");
            float w = h * Screen.width / Screen.height;

            // Set clipping to ConstrainButDontClip
            SSReflection.SetPropValue(m_UIPanel, "clipping", ConstrainButDontClip);

            // Set clipping region
            SSReflection.SetPropValue(m_UIPanel, "baseClipRegion", new Vector4(0, 0, w, h));
        }
    }
Exemple #2
0
 void SetColorReflection(Component comp, Color color)
 {
     SSReflection.SetPropValue(comp, "color", color);
 }
Exemple #3
0
 void SetColorReflection(Component comp, string text)
 {
     SSReflection.SetPropValue(comp, "text", text);
 }