Ejemplo n.º 1
0
    void OnClickItemLocation(MoveMenuInfo info)
    {
        switch (info.menu)
        {
        case GameMenu.Dungeon:
            pe_Difficulty difficulty = (pe_Difficulty)Enum.Parse(typeof(pe_Difficulty), info.menu_parm_2);
            if (MapClearDataManager.Instance.AvailableMap(info.menu_parm_1, difficulty) == false)
            {
                Tooltip.Instance.ShowMessageKey("NotAvailbleStage");
                return;
            }
            Network.TargetItemInfo = m_Info;
            GameMain.Instance.StackPopup();

            MenuParams parm = new MenuParams();
            parm.AddParam("menu_parm_1", info.menu_parm_1);
            parm.AddParam("menu_parm_2", info.menu_parm_2);
            GameMain.Instance.ChangeMenu(info.menu, parm);
            break;

        case GameMenu.Store:
            GameMain.Instance.StackPopup();
            GameMain.MoveStore(info.menu_parm_1);
            break;

        default:
            GameMain.Instance.StackPopup();
            GameMain.Instance.ChangeMenu(info.menu);
            break;
        }
    }
Ejemplo n.º 2
0
    //---------------------------------------------------------------------------
    public void Init(MoveMenuInfo info, OnItemLocationDelegate _del)
    {
        MenuInfo                     = info;
        OnItemLocation               = _del;
        m_LabelChapter.text          = info.title;
        m_LabelName.text             = info.desc;
        m_SpritePlaceIcon.spriteName = info.icon_id;

        if (MenuInfo.menu == GameMenu.Dungeon)
        {
            pe_Difficulty difficulty = (pe_Difficulty)Enum.Parse(typeof(pe_Difficulty), MenuInfo.menu_parm_2);

            if (MapClearDataManager.Instance.AvailableMap(MenuInfo.menu_parm_1, difficulty) == false)
            {
                m_ButtonMove.SetState(UIButtonColor.State.Disabled, true);
                m_ButtonMove.GetComponent <BoxCollider2D>().enabled = false;
                m_LabelMove.color = Color.grey;
                return;
            }
        }
        m_ButtonMove.SetState(UIButtonColor.State.Normal, true);
        m_ButtonMove.GetComponent <BoxCollider2D>().enabled = true;
        m_LabelMove.color = Color.white;
    }