void Update()
 {
     for (int i = 0; i < SelectionIndex.Values.Count; i++)
     {
         LMS_GuiViewSelection view = SelectionIndex[i].Key as LMS_GuiViewSelection;
         SelectionIndex[i].Value.ForceDownState(i == selectedIndex);
         if (i != selectedIndex)
         {
             continue;
         }
         ActiveHierarchyLabel.Config.Text = view.Title;
         //OptText.Config.Text = view.Text;
     }
 }
示例#2
0
    void InitButtonDefault(LMS_GuiBaseButton b, string text, string title, LMS_GuiBaseButton.ClickCallbackDelegate onClick = null)
    {
        b.SetTexture((int)E_Texture.DOWN, LMS_Textures.GetCache("BUTTON_TEX"));
        b.SetTexture((int)E_Texture.IDLE, b.GeneratePlainTexture(Color.clear));
        b.BlendMode = E_BlendMode.BLENDED;
        if (onClick != null)
        {
            b.OnClick += onClick;
        }
        LMS_GuiViewSelection sel = new LMS_GuiViewSelection
        {
            Text            = text,
            Title           = title,
            CollectionIndex = SelectionIndex.Values.Count
        };

        SelectionIndex[sel.CollectionIndex] = new KeyValuePair <LMS_GuiView, LMS_GuiBaseButton>(sel, b);
    }
    void InitButtonDefault(LMS_GuiBaseButton b, string text, string title, int textSize = 15, LMS_GuiBaseButton.ClickCallbackDelegate onClick = null)
    {
        b.SetTexture((int)E_Texture.DOWN, m_Skin.button.active.background);
        b.SetTexture((int)E_Texture.IDLE, LMS_GuiBaseUtils.NextGrade(m_Skin.button.normal.background));
        b.BlendMode = E_BlendMode.NORMAL;
        if (onClick != null)
        {
            b.OnClick += onClick;
        }
        LMS_GuiViewSelection sel = new LMS_GuiViewSelection
        {
            Text            = text,
            Title           = "<size=" + textSize + ">" + title + "</size>",
            CollectionIndex = SelectionIndex.Values.Count
        };

        SelectionIndex[sel.CollectionIndex] = new KeyValuePair <LMS_GuiView, LMS_GuiBaseButton>(sel, b);
    }
示例#4
0
    void InitButtonDefault(LMS_GuiBaseButton b, string text = "", string title = "", LMS_GuiBaseButton.ClickCallbackDelegate onClick = null)
    {
        b.SetTexture((int)E_Texture.DOWN, m_Skin.button.active.background);
        b.SetTexture((int)E_Texture.IDLE, m_Skin.button.normal.background);
        b.BlendMode = E_BlendMode.BLENDED;
        if (onClick != null)
        {
            b.OnClick += onClick;
        }
        LMS_GuiViewSelection sel = new LMS_GuiViewSelection
        {
            Text            = text,
            Title           = title,
            CollectionIndex = SelectionIndex.Values.Count
        };

        SelectionIndex[sel.CollectionIndex] = new KeyValuePair <LMS_GuiView, LMS_GuiBaseButton>(sel, b);
    }
示例#5
0
    void Update()
    {
#if UNITY_EDITOR
        if (Input.GetKeyDown(KeyCode.DownArrow))
        {
            if (selectedIndex + 1 == SelectionIndex.Count)
            {
                selectedIndex = 0;
            }
            else
            {
                selectedIndex++;
            }
        }
        else if (Input.GetKeyDown(KeyCode.UpArrow))
        {
            if (selectedIndex - 1 == -1)
            {
                selectedIndex = SelectionIndex.Count - 1;
            }
            else
            {
                selectedIndex--;
            }
        }
#endif
        for (int i = 0; i < SelectionIndex.Values.Count; i++)
        {
            LMS_GuiViewSelection view = SelectionIndex[i].Key as LMS_GuiViewSelection;
            SelectionIndex[i].Value.ForceDownState(i == selectedIndex);
            if (i != selectedIndex)
            {
                continue;
            }
            OptTitle.Config.Text = view.Title;
            OptText.Config.Text  = view.Text;
        }
    }