Пример #1
0
    public override void GameSetting()
    {
        for (int i = 0; i < m_Buttons.Length; i++)
        {
            m_ButtonDic.Add(m_Buttons[i].name, m_Buttons[i].gameObject);
            string btnName = m_Buttons[i].name;
            m_Buttons[i].onClick.AddListener(() => MenuButtonClick(btnName));
        }
        //m_ButtonBaseSize = m_Buttons[0].image.rectTransform.sizeDelta;
        m_ContentSizeFitter = m_MenuBoard.GetComponent <ContentSizeFitter>();
        m_MenuTypeDic.Add(MenuType.TileMenu, m_TileMenu);
        m_MenuTypeDic.Add(MenuType.PlayerShopMenu, m_PlayerShopMenu);
        m_MenuTypeDic.Add(MenuType.PlayerStandShopMenu, m_PlayerStandShopMenu);
        m_MenuTypeDic.Add(MenuType.PlayerDeadMenu, m_PlayerDeadMenu);
        m_MenuTypeDic.Add(MenuType.PlayerMoveCanAtkMenu, m_PlayerMoveCanAtkMenu);

        //for (MenuType i = MenuType.START + 1; i < MenuType.MAX; i++)
        //{
        //    MenuType menuType = i;
        //    string[] temp = (string[])GetType().GetField("m_" + i.ToString()).GetValue(this);
        //    if (temp != null)
        //    {
        //        m_MenuTypeDic.Add(menuType, temp);
        //    }
        //}
        m_UIBlockImage = m_UIBlock.GetComponent <Image>();
        //m_UIBlock.onClick.AddListener(UIBlockClick);
        m_UIBlock.SetPointEvent(UIBlockClick);
        UIBlockSwitch(false);
        SetMsgShow(false);

        m_TileMask = LayerMask.GetMask("Tile");
        m_ButtonCOnfirmYes.onClick.AddListener(ConfirmYesClick);
        m_ButtonCOnfirmNo.onClick.AddListener(ConfirmNoClick);
    }