コード例 #1
0
    public void InitGui()
    {
        GUIBase_Pivot  Pivot  = MFGuiManager.Instance.GetPivot("ShopMenu");
        GUIBase_Layout Layout = Pivot.GetLayout("Scroller_Layout");

        GUIBase_Pivot scrollerPivot = GuiBaseUtils.GetChild <GUIBase_Pivot>(Layout, "Scroll_Pivot");

        m_ScrollInventory.InitGui(Layout, scrollerPivot);

        /*m_InfoPopup.GuiInit();
         * m_ScrollInventory.m_OnHoldBegin = ShowInfoPopup;
         * m_ScrollInventory.m_OnHoldEnd = HideInfoPopup;*/

        // anchor scroll bar to the bottom of the screen
        if (MFGuiManager.ForcePreserveAspectRatio)
        {
            Transform trans    = Layout.transform;
            Vector3   position = trans.position;

            GUIBase_Widget specialBottomCara = Layout.GetWidget("SpecialBottom_cara");
            Rect           bbox = specialBottomCara.GetBBox();
            bbox.y        -= position.y;
            position.y     = Screen.height - bbox.yMax;
            trans.position = position;
        }
    }
コード例 #2
0
    public void InitGui()
    {
        GUIBase_Pivot  Pivot  = MFGuiManager.Instance.GetPivot("MainResearch");
        GUIBase_Layout Layout = Pivot.GetLayout("ResearchScroller_Layout");

        GUIBase_Pivot scrollerPivot = GuiBaseUtils.GetChild <GUIBase_Pivot>(Layout, "Scroller");

        m_ScrollInventory.InitGui(Layout, scrollerPivot);

        GUIBase_Widget iconsRoot = Layout.GetWidget("ResearchIcons");

        m_Icons = new GUIBase_Sprite[maxScrollItems];
        for (int i = 0; i < maxScrollItems; i++)
        {
            m_Icons[i] = GuiBaseUtils.GetChildSprite(iconsRoot, "Icon" + i);
        }

        // anchor scroll bar to the bottom of the screen
        if (MFGuiManager.ForcePreserveAspectRatio)
        {
            Transform trans    = Layout.transform;
            Vector3   position = trans.position;

            GUIBase_Widget specialBottomCara = Layout.GetWidget("SpecialBottom_cara");
            Rect           bbox = specialBottomCara.GetBBox();
            bbox.y        -= position.y;
            position.y     = Screen.height - bbox.yMax;
            trans.position = position;
        }
    }