Exemplo n.º 1
0
        public void hideTrainStart()
        {
            if (!dynamiclistUI.getIsShow())
            {
                dynamiclistUI.showSpInfoUI();
            }
            mouseFocus.cancelHighLightObj();
            mouseFocus.reset();
            isShowTrainStart = false;
            trainStartUI.gameObject.SetActive(false);
            if (!isStartTrain)
            {
                mouseFocus.ForbiddenWalk(true);

                TrainingBigFlow trainingFlow = TrainingManager.flows[this.CurrentTrainFlow];
                addHintMSG(trainingFlow.operateHint);
                if (currentTrainMode == TrainMode.Study)
                {
                    PluginEventManager.FireEvent("StartPlayFlow", this.CurrentTrainFlow + ",自动浏览,0");                    //自动浏览
                }
                else if (currentTrainMode == TrainMode.Training)
                {
                    PluginEventManager.FireEvent("StartPlayFlow", this.CurrentTrainFlow + ",半自动浏览,0");                    //半自动浏览
                }
                else if (currentTrainMode == TrainMode.Exam)
                {
                    PluginEventManager.FireEvent("StartPlayFlow", this.CurrentTrainFlow + ",考核,0");                    //考核
                    examCountDown.startTimer();
                }
                isStartTrain = true;
            }
        }
Exemplo n.º 2
0
        public void initFlowMenu(Action <int> action, TrainUI.TrainMode currentTrainMode)
        {
            if (!isShowGrid)
            {
                showGrid();
            }
            isCircuit      = false;
            isShowToolMenu = false;
            showFlowMenu();
            flows = new Dictionary <int, FlowItem>();
            rest();
            this.action           = action;
            this.currentTrainMode = currentTrainMode;
            TrainingBigFlow bigFlow = TrainingManager.getTrainingBigFlow(UIManager.getInstance().trainUI.CurrentTrainFlow);

            for (int i = 0; i < bigFlow.getFlowIndexs().Count; i++)
            {
                TrainingFlow flow = bigFlow.getTrainingFlow(i);
                GameObject   obj  = ResourceManager.getInstance().loadUISpawnPool(flowItemPrefab, null);
                obj.transform.position = Vector3.zero;
                obj.name = i.ToString();
                grid.AddChild(obj.transform);
                UIEventListener.Get(obj).onClick = flowItemClick;
                FlowItem flowItem = new FlowItem();
                flowItem.index = i;
                flowItem.obj   = obj;
                flowItem.arrow = obj.transform.Find("arrow").gameObject;
                flowItem.arrow.gameObject.SetActive(false);
                flowItem.name      = obj.transform.Find("name").GetComponent <UILabel>();
                flowItem.name.text = flow.name;
                flows.Add(i, flowItem);
                setCurrentFlow(0, currentTrainMode);
            }
            flowOperateTitle.spriteName = getFlowTitleSprite(currentTrainMode, isShowToolMenu);
            flowOperateTitle.GetComponent <UIButton>().normalSprite = flowOperateTitle.spriteName;

            scrollView.gameObject.SetActive(false);
            scrollView.gameObject.SetActive(true);
            grid.repositionNow = true;
            grid.Reposition();
            scrollBar.value = 0;
            scrollView.GetComponent <UIPanel>().Invalidate(true);
        }
Exemplo n.º 3
0
        private string getTrainTypeStr()
        {
            string str = "";

            if (!isCircuit)
            {
                TrainingBigFlow bigFlow = TrainingManager.getTrainingBigFlow(UIManager.getInstance().trainUI.CurrentTrainFlow);
                switch (bigFlow.name)
                {
                case "设备拆解":
                    str += "shebeichaijie";
                    break;

                case "设备组装":
                    str += "shebeizuzhuang";
                    break;

                case "设备巡视":
                    str += "shebeixunshi";
                    break;

                case "设备检修":
                    str += "shebeijianxiu";
                    break;

                case "设备故障":
                    str += "shebeiguzhang";
                    break;
                }
            }
            else
            {
                str += "dianluyuanli";
            }
            return(str);
        }