Пример #1
0
        void OnEnable()
        {
            //this.RefereshMainScene();
            this.DoRefereshSceneLoad();

            RegistBuildingButtonClickEvtProc();
            SaveEntryElementOnBuild();

            //初始化人物样式
            playerEntity = RemoteModel.Instance.Player;
            playerEntity.addEventListener(PlayerEntity.MainNinjaChangeEvent, UpdateActor);
            KHEvent initEvent = new KHEvent("init");

            initEvent.data = playerEntity.MainNinja;
            UpdateActor(initEvent);

            KHUIManager.getInstance().Dispatcher.addEventListener("OnOpenWindow", OnOpenOtherWindow);
            KHUIManager.getInstance().Dispatcher.addEventListener("OnCloseWindow", OnCloseOtherWindow);

            mainModel = KHPluginManager.Instance.GetModel("MainUI") as MainUIModel;
            mainModel.Dispatcher.addEventListener(UIMainScene.EVT_REQ_SCENE_CHANGE_CHECK, OnReqSceneChangeCheckRecived);


            KHSceneSettingModel sceneSettingModel = KHPluginManager.Instance.GetModel(KHSceneSettingPlugin.pluginName) as KHSceneSettingModel;

            sceneSettingModel.Dispatcher.addEventListener(KHSceneSettingModel.SELECT_SCENE_SETTING_EVT, OnRreshSceneSetting);
            sceneSettingModel.Dispatcher.addEventListener(KHSceneSettingModel.PREVIEW_SCENE_SETTING_CANCEL_EVT, OnRreshSceneSetting);

            sceneSettingModel.Dispatcher.addEventListener(KHSceneSettingModel.PREVIEW_SCENE_SETTING_EVT, OnRreshSceneSetting);
            //显示气泡;
            ShowBubble();
        }
Пример #2
0
    public MainUIConfig()
    {
        prefab_Path = "MainUI";

        View  = new MainUI();
        Ctrl  = new MainUICtrl();
        Model = new MainUIModel();

        layer = ENUM_UILayer.Normal;
        InitConfig();
    }
    public void RefreshShowState(bool _showFlag, string _winName = "")
    {
        if (_needHideObj == null)
        {
            return;
        }

        _needHideObj.SetActive(_showFlag);

        KHUIManager.getInstance().SendMessage(UIDef.MAIN_BAR_VIEW, "UpdateContainerVisible", _showFlag);

        if (false == _showFlag)
        {
            MainUIModel tMainUiMode = KHPluginManager.Instance.GetModel("MainUI") as MainUIModel;
            tMainUiMode.Dispatcher.dispatchEvent(new KHEvent(EVT_REQ_SCENE_CHANGE_CHECK));
        }
        else
        {
            //KHUIManager.ResetCameraBoundForDeviceWhileWndChanged(UIDef.MAIN_PAGE_VIEW);
        }
    }