Esempio n. 1
0
    public override void Init()
    {
        _visitPanel = new VisitPanel();
        _visitPanel.Init(this);
        _visitPanel.Show(0.5f);

        GuideManager.RegisterModule(this);
    }
Esempio n. 2
0
    public override void OnMessage(Message message)
    {
        string name = message.Name;

        object[] body = message.Params;
        switch (name)
        {
        case MessageConst.MODULE_VISIT_SHOW_VISIT_PANEL:
            HideAll();
            if (_visitPanel == null)
            {
                _visitPanel = new VisitPanel();
                _visitPanel.Init(this);
            }
            else
            {
                _visitPanel.Refeash();
            }
            _visitPanel.Show(0.5f);
            break;

        case MessageConst.MODULE_VISIT_SHOW_WEATHER_PANEL:
            HideAll();
            if (_weatherPanel == null)
            {
                _weatherPanel = new WeatherPanel();
                _weatherPanel.Init(this);
            }
            PlayerPB npcId = (PlayerPB)body[0];
            _weatherPanel.SetData(npcId);
            _weatherPanel.Show(0.5f);
            break;

        case MessageConst.MODULE_VISIT_SHOW_LEVEL_PANEL:
            HideAll();
            if (_visitLevelPanel == null)
            {
                _visitLevelPanel = new VisitLevelPanel();
                _visitLevelPanel.Init(this);
            }
            _visitLevelPanel.SetData((PlayerPB)body[0]);
            _visitLevelPanel.Show(0.5f);
            break;

        case MessageConst.MODULE_VISIT_WEATHER_SET_BACKBTNSHOWORHIDE:
            if (_weatherPanel != null)
            {
                bool isShow = (bool)body[0];
                if (!isShow)
                {
                    _weatherPanel.HideBackBtn();
                }
                else
                {
                    _weatherPanel.ShowBackBtn();
                }
            }
            break;

        default:
            break;
        }
    }