Esempio n. 1
0
    public IEnumerator Win()
    {
        Running = false;

        MOB[1].transform.position = EndPoint.position;
        EndInfo.TweenActive(true);
        EndInfo.Txt[0].text = "SAFE!";

        yield return(new WaitForSeconds(0.7F));

        EndInfo.Txt[0].text = "FITNESS UP: " + (TargetGrand.Data.Fitness.RatioToString()) + "%";
        Tweens.Bounce(EndInfo.Txt[0].transform);

        yield return(new WaitForSeconds(Time.deltaTime * 40));

        int fit = 30 + (int)Mathf.Clamp(50 - GameTime, 0, 30);

        TargetGrand.Data.Fitness.Add(fit);

        EndInfo.Txt[0].text = "FITNESS UP: " + (TargetGrand.Data.Fitness.RatioToString()) + "%";
        Tweens.Bounce(EndInfo.Txt[0].transform);

        yield return(new WaitForSeconds(Time.deltaTime * 40));

        int rep = fit;

        StartCoroutine(GameManager.UI.ResourceAlert(GameManager.WorldRes.Rep, rep));
        EndInfo.Txt[0].text = "REP UP: " + rep;
        Tweens.Bounce(EndInfo.Txt[0].transform);

        EndButton.TweenActive(true);
    }
Esempio n. 2
0
        private void SetBtn(int index = 0)//根据界面类型设置按钮 0未开始,1可参加,2已结束
        {
            switch (index)
            {
            case 0:
            {
                string str = string.Empty;
                if (isTimeLimit)
                {
                    str = string.Format("[FD3A41FF]{0} {1}[-]", EB.Localizer.GetString("ID_NEXT_WEEK"), EB.Localizer.GetString("ID_uifont_in_LTMainMenu_Label_13"));
                }
                else
                {
                    string.Format("[FD3A41FF]{0}[-]", GetTimeStr());
                }
                TimeLabel.text = TimeLabel.transform.GetChild(0).GetComponent <UILabel>().text = str;
                JoinButton.CustomSetActive(false);
                EndButton.transform.GetChild(0).GetComponent <UILabel>().text = EndButton.transform.GetChild(0).GetChild(0).GetComponent <UILabel>().text = EB.Localizer.GetString("ID_codefont_in_LTLegionWarJoinController_1816");
                EndButton.CustomSetActive(true);
            }
            break;

            case 1:
            {
                TimeLabel.text = TimeLabel.transform.GetChild(0).GetComponent <UILabel>().text = string.Format("[3FFCC0FF]{0}[-]", GetTimeStr());
                int ts = 0;
                if (LTLegionWarTimeLine.Instance != null)
                {
                    ts = (int)((_LTLegionWarTabValue == LTLegionWarTabValue.Semifinal) ? LTLegionWarTimeLine.Instance.SemiFinalStopTime : LTLegionWarTimeLine.Instance.FinalStopTime) - EB.Time.Now;
                }
                bool btnType = ts >= 0;
                JoinButton.CustomSetActive(btnType);
                if (!btnType)
                {
                    EndButton.transform.GetChild(0).GetComponent <UILabel>().text = EndButton.transform.GetChild(0).GetChild(0).GetComponent <UILabel>().text = EB.Localizer.GetString("ID_codefont_in_LTLegionWarFinalController_4204");
                }
                EndButton.CustomSetActive(!btnType);
            }
            break;

            case 2:
            {
                TimeLabel.text = TimeLabel.transform.GetChild(0).GetComponent <UILabel>().text = string.Format("[FD3A41FF]{0}[-]", GetTimeStr());
                JoinButton.CustomSetActive(false);
                EndButton.transform.GetChild(0).GetComponent <UILabel>().text = EndButton.transform.GetChild(0).GetChild(0).GetComponent <UILabel>().text = EB.Localizer.GetString("ID_codefont_in_LTLegionWarFinalController_4850");
                EndButton.CustomSetActive(true);
            }
            break;

            default:
            {
                JoinButton.CustomSetActive(false);
                EndButton.CustomSetActive(false);
                EB.Debug.LogError("SetBtn is Error!");
            }
            break;
            }
        }
        public void Update()
        {
            if (InConvo)
            {
                myText.text = ScrollText.Instance.OutputText;

                if (ScrollText.Instance.isFinished())
                {
                    if (!CanContinue)
                    {
                        if (!ContinueButton.activeSelf)
                        {
                            CurrentDialogue++;
                            if (CurrentDialogue < Dialogues.Length)
                            {
                                ContinueButton.SetActive(true);
                            }
                            else
                            {
                                InConvo = false;
                                //show options.

                                var ListOVals = entryTrans.responses.Values.ToList();

                                //if no options, end of dialogue
                                if (ListOVals.Count < 1)
                                {
                                    //ConvoDone = true;
                                    EndButton.SetActive(true);
                                    //bring up the end button.
                                    return;
                                }

                                else
                                {
                                    // if there are options, spawn the buttons.
                                    int NumOptions = ListOVals.Count;
                                    int i          = 0;

                                    foreach (String option in ListOVals)
                                    {
                                        //setup
                                        var obj = Instantiate(OptionButtonPrefab, transform);
                                        obj.GetComponent <RectTransform>().localPosition  = new Vector3(-227, 200, 0);
                                        obj.GetComponent <RectTransform>().localPosition += new Vector3(i * 310, 0, 0);
                                        obj.GetComponent <DialogueOptionButton>().SetConvoID(entryTrans.responses.FirstOrDefault(x => x.Value == option).Key, option);

                                        OptionButtons.Add(obj);

                                        i++;
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Esempio n. 4
0
    public void Lose()
    {
        Running = false;

        MOB[1].transform.rotation = Quaternion.Slerp(
            MOB[1].transform.rotation,
            Quaternion.Euler(0.0F, 0.0F, Sway_CurrentVelocity.x * 90),
            Time.deltaTime * 60);
        EndInfo.TweenActive(true);
        EndInfo.Txt[0].text = "FELL OVER!";
        EndButton.TweenActive(true);
    }
Esempio n. 5
0
    public void Reset()
    {
        CurrentStage   = EVENT_STAGE.NO_EVENT;
        CurrentEvent   = null;
        CurrentEvent   = null;
        SelectedOption = null;

        i_ChosenOption = 0;

        EndButton.SetActive(false);
        EventPanel.SetActive(false);
    }
Esempio n. 6
0
        /// <summary>
        /// </summary>
        public static void DrawEnd(EndButton btnEnd)
        {
            if (btnEnd != null)
            {
                using (GraphicsPath path1 = new GraphicsPath())
                {
                    path1.AddEllipse(0, 0, btnEnd.Radius * 2, btnEnd.Radius * 2);
                    // path1.AddEllipse(btnEnd.Radius / 2, btnEnd.Radius / 2, btnEnd.Radius, btnEnd.Radius);
                    btnEnd.Region = new Region(path1);
                }
                btnEnd.Size = new Size(btnEnd.Radius * 2, btnEnd.Radius * 2);

                Point arrowPoint = DrawUtility.GetCyclePoint(100, 0, btnEnd.InArrowDegree);
                btnEnd.Left = btnEnd.InPoint.X + arrowPoint.X * btnEnd.Radius / 100 - btnEnd.Radius;
                btnEnd.Top  = btnEnd.InPoint.Y + arrowPoint.Y * btnEnd.Radius / 100 - btnEnd.Radius;
            }
        }
Esempio n. 7
0
        void ReleaseDesignerOutlets()
        {
            if (EndButton != null)
            {
                EndButton.Dispose();
                EndButton = null;
            }

            if (StartButton != null)
            {
                StartButton.Dispose();
                StartButton = null;
            }

            if (Timer != null)
            {
                Timer.Dispose();
                Timer = null;
            }
        }
Esempio n. 8
0
 void Awake()
 {
     _instance = this;
     label     = transform.Find("Label").GetComponent <UILabel>();
 }
Esempio n. 9
0
        private bool initFlowPicBox()
        {
            clear();
            string routeCode = "",
                   moCode    = "",
                   itemCode;

            object[] objs;

            if (string.IsNullOrEmpty(Convert.ToString(this.drownListMoCode.SelectedItemValue)))
            {
                return(false);
            }
            moCode = Convert.ToString(this.drownListMoCode.SelectedItemValue);
            if (string.IsNullOrEmpty(Convert.ToString(this.drownListRouteCode.SelectedItemValue)))
            {
                return(false);
            }
            routeCode = Convert.ToString(this.drownListRouteCode.SelectedItemValue);

            Messages msg = new Messages();

            if (m_DataCollectFacade == null)
            {
                m_DataCollectFacade = new DataCollectFacade(this.DataProvider);
            }
            try
            {
                //add
                string sourceRcard = m_DataCollectFacade.GetSourceCard(FormatHelper.CleanString(txtRcard.Text.ToUpper()), this.drownListMoCode.SelectedItemValue.ToString());
                //end
                //object objLastSimRe = m_DataCollectFacade.GetLastSimulationReport(FormatHelper.CleanString(sourceRcard));
                object objLastSimRe = m_DataCollectFacade.GetSimulationReport(this.drownListMoCode.SelectedItemValue.ToString(), FormatHelper.CleanString(sourceRcard));


                if (objLastSimRe == null)
                {
                    msg.Add(new UserControl.Message(MessageType.Error, "$Error_CS_ID_Not_Exist"));
                    txtRcard.SelectAll();
                    txtRcard.Focus();
                    ApplicationRun.GetInfoForm().Add(msg);
                    return(false);
                }
                else
                {
                    SimulationReport currentSimRe = (SimulationReport)objLastSimRe;
                    itemCode = currentSimRe.ItemCode;

                    //查询当前途程工序捞TBLITEMROUTE2OP表
                    //QueryItemOpFlow(当前itemCode,当前途程Code);
                    objs = m_DataCollectFacade.QueryItemOpFlow(itemCode, routeCode);
                    if (objs == null)
                    {
                        ApplicationRun.GetInfoForm().Add(new UserControl.Message(MessageType.Normal, "$CS_No_Data_To_Display"));
                        //add by klaus 置焦点
                        txtRcard.SelectAll();
                        txtRcard.Focus();
                        return(false);
                    }

                    #region 画流程图
                    this.panelDrawFlow.Controls.Clear();
                    this.panelDrawFlow.Refresh();

                    StartButton btnStart = new StartButton();
                    this.panelDrawFlow.Controls.Add(btnStart);
                    btnStart.setProcessName(MutiLanguages.ParserString("$CS_Start"));
                    btnStart.Location = new Point(10, 30);
                    btnStart.DrawButton();

                    FunctionButton lastOne = btnStart;
                    FlowButton     btnFlow = new StraightArrowButton();
                    double         vdegree = 0;

                    ItemRoute2OP currentOP = null;

                    for (int i = 0; i < objs.Length; i++)
                    {
                        ItemRoute2OP itemRoute2Op = objs[i] as ItemRoute2OP;

                        btnFlow = lastOne.AddOutArrow(vdegree);
                        Operation op = (Operation) new BaseModelFacade(this.DataProvider).GetOperation(itemRoute2Op.OPCode);
                        lastOne = btnFlow.AddOutProcess(itemRoute2Op.OPCode);

                        lastOne.Tag       = itemRoute2Op.OPCode;
                        lastOne.ProcessID = op.OPDescription;
                        lastOne.DrawButton();
                        lastOne.BackColor = Color.Green;
                        lastOne.Click    += new EventHandler(btn_Click);

                        //string actionResult = m_DataCollectFacade.CheckOpIsExist(FormatHelper.CleanString(txtRcard.Text.Trim().ToUpper()), moCode, routeCode, itemRoute2Op.OPCode);
                        string actionResult = m_DataCollectFacade.CheckOpIsExist(sourceRcard, moCode, routeCode, itemRoute2Op.OPCode);
                        if (string.IsNullOrEmpty(actionResult))
                        {
                            lastOne.BackColor = Color.White;
                        }
                        else
                        {
                            if (actionResult == ProductStatus.GOOD)
                            {
                                lastOne.BackColor = Color.Green;
                            }
                            else
                            {
                                lastOne.BackColor = Color.Red;
                            }
                        }

                        if (itemRoute2Op.OPCode == currentSimRe.OPCode &&
                            itemRoute2Op.RouteCode == currentSimRe.RouteCode)
                        {
                            currentOP = (ItemRoute2OP)objs[i];
                            if (currentSimRe.Status == ProductStatus.GOOD)
                            {
                                lastOne.BackColor = Color.Green;
                            }
                            else
                            {
                                lastOne.BackColor = Color.Red;
                            }
                        }

                        #region 注释 Terry 2012-11-13
                        //如果途程里工序是从0开始,显示背景有问题。
                        //if ((currentOP != null) && (i > currentOP.OPSequence - 1))
                        //{
                        //    lastOne.BackColor = Color.WhiteSmoke;
                        //}
                        #endregion

                        if ((btnFlow as StraightArrowButton).Degree == 90)
                        {
                            vdegree = (vdegree + 180) % 360;
                        }
                    }
                    btnFlow = lastOne.AddOutArrow(vdegree);
                    EndButton btnEnd = btnFlow.AddEnd();
                    btnEnd.Text      = MutiLanguages.ParserString("$CS_End");
                    btnEnd.BackColor = lastOne.BackColor;
                    #endregion

                    return(true);
                }
            }
            catch (Exception ex)
            {
                msg.Add(new UserControl.Message(ex));
                ApplicationRun.GetInfoForm().Add(msg);
                txtRcard.Focus();
                return(false);
            }
        }
 public void EndDialogue()
 {
     ConvoDone = true;
     SwitchPanelStuff(false);
     EndButton.SetActive(false);
 }
Esempio n. 11
0
        /// <summary>
        /// シーン内の描画処理
        /// </summary>
        public void Draw()
        {
            TextureAsset.Draw(LogoImageHandle, 490, 90, 300, 300, DX.TRUE);
            IpAddressText.Draw();
            PortNumberText.Draw();
            SaveIpAddressButton.Draw();
            switch (state)
            {
            case State.Start:
                StartButton.Draw();
                StartButton.DrawText();
                EndButton.Draw();
                EndButton.DrawText();
                break;

            case State.Select:
                BackButton.Draw();
                BackButton.DrawText();
                MakeRoomButton.Draw();
                MakeRoomButton.DrawText();
                JoinRoomButton.Draw();
                JoinRoomButton.DrawText();
                break;

            case State.FindRoom:
                BackButton.Draw();
                BackButton.DrawText();
                FindRoomButton.Draw();
                FindRoomButton.DrawText();
                SubmitButton.Draw();
                SubmitButton.DrawText();
                roomName.Draw();
                playerName.Draw();
                FontAsset.Draw("button1Base", "部屋名", roomName.x1 - 250, roomName.y1 + 5, DX.GetColor(125, 125, 125));
                FontAsset.Draw("button1Base", "プレイヤー名", playerName.x1 - 250, playerName.y1 + 5, DX.GetColor(125, 125, 125));
                break;

            case State.MakeRoom:
                BackButton.Draw();
                BackButton.DrawText();
                SubmitButton.Draw();
                SubmitButton.DrawText();
                roomName.Draw();
                playerName.Draw();
                playerNum.Draw();
                FontAsset.Draw("button1Base", "部屋名", roomName.x1 - 260, roomName.y1 + 5, DX.GetColor(125, 125, 125));
                FontAsset.Draw("button1Base", "プレイヤー名", playerName.x1 - 260, playerName.y1 + 5, DX.GetColor(125, 125, 125));
                FontAsset.Draw("button1Base", "人数", playerNum.x1 - 260, playerNum.y1 + 5, DX.GetColor(125, 125, 125));
                break;

            case State.Load:
                BackButton.Draw();
                BackButton.DrawText();
                LoadTexture.Draw();
                break;

            case State.Popup:
                if (FindRoomWindow.IsVisible)
                {
                    FindRoomWindow.Draw();
                }
                break;

            default:
                break;
            }
        }
Esempio n. 12
0
        /// <summary>
        /// シーン内の更新処理
        /// </summary>
        public void Update()
        {
            // IPアドレス関連の更新
            IpAddressText.Update();
            PortNumberText.Update();
            if (SaveIpAddressButton.LeftClicked())
            {
                if (IPAddress.TryParse(IpAddressText.Text, out _) &&
                    int.TryParse(PortNumberText.Text, out _))
                {
                    SocketManager.SetAddress(IpAddressText.Text, int.Parse(PortNumberText.Text));
                }
            }

            // メインの更新処理
            switch (state)
            {
            // スタートボタンを押す画面
            case State.Start:
                if (StartButton.LeftClicked())
                {
                    state = State.Select;
                }
                if (EndButton.LeftClicked())
                {
                    DX.DxLib_End();
                    return;
                }
                break;

            // 部屋を作るか、部屋に参加するか選ぶ画面
            case State.Select:
                if (BackButton.LeftClicked())
                {
                    state = State.Start;
                }
                if (MakeRoomButton.LeftClicked())
                {
                    state = State.MakeRoom;
                }
                if (JoinRoomButton.LeftClicked())
                {
                    state         = State.FindRoom;
                    roomName.Text = string.Empty;
                }
                break;

            // 部屋を作る画面
            case State.FindRoom:
                if (BackButton.LeftClicked())
                {
                    state = State.Start;
                }
                if (SubmitButton.LeftClicked())
                {
                    if (roomName.Text.Length != 0 &&
                        playerName.Text.Length != 0)
                    {
                        state           = State.Load;
                        Data.PlayerName = playerName.Text;
                        Data.RoomName   = roomName.Text;
                    }
                    IsWaitJoin = false;
                }
                if (FindRoomButton.LeftClicked())
                {
                    state = State.Popup;
                    FindRoomWindow.IsVisible = true;
                }
                roomName.Update();
                playerName.Update();
                break;

            // 部屋に参加する画面
            case State.MakeRoom:
                if (BackButton.LeftClicked())
                {
                    state = State.Start;
                }
                if (SubmitButton.LeftClicked())
                {
                    if (roomName.Text.Length != 0 &&
                        playerName.Text.Length != 0 &&
                        playerNum.Text.Length != 0)
                    {
                        state           = State.Load;
                        Data.PlayerName = playerName.Text;
                        Data.RoomName   = roomName.Text;
                        var num = int.Parse(playerNum.Text);
                        if (num > 4 || num < 0)
                        {
                            num            = 4;
                            playerNum.Text = num.ToString();
                        }
                        Data.PlayerNum = num;
                        IsWaitJoin     = false;
                    }
                }
                roomName.Update();
                playerName.Update();
                playerNum.Update();
                break;

            // ロード画面
            case State.Load:
                if (BackButton.LeftClicked())
                {
                    state = State.Start;
                }
                if (!IsWaitJoin)
                {
                    IsWaitJoin = true;
                    Task.Run(() => JoinMatch(Data.RoomName, Data.PlayerName));
                }
                if (!LoadTexture.IsVisible())
                {
                    LoadTexture.Start();
                }
                LoadTexture.Update();
                break;

            // 部屋を探す画面
            case State.Popup:
                FindRoomWindow.Update();
                if (!FindRoomWindow.IsVisible)
                {
                    Data.MatchInfo = FindRoomWindow.GetSelectedMatch();
                    roomName.Text  = Data.MatchInfo.MatchKey;
                    state          = State.FindRoom;
                }
                break;

            // ゲームシーンに遷移する処理を行う状態
            case State.ChangeGameScene:
                SceneManager.ChangeScene(SceneManager.SceneName.Game);
                break;

            default:
                break;
            }
        }
Esempio n. 13
0
    // Update is called once per frame
    void Update()
    {
        switch (CurrentStage)
        {
        case EVENT_STAGE.NO_EVENT:

            if (CurrentEvent)
            {
                CurrentStage = EVENT_STAGE.CHOOSE_OPTION;
            }

            break;

        case EVENT_STAGE.CHOOSE_OPTION:

            EventPanel.SetActive(true);
            Option1.SetActive(true);
            Option2.SetActive(true);
            Option3.SetActive(true);

            // Apply UI/Text
            Title.text       = CurrentEvent.GetComponent <EventBase>().Title;
            Description.text = CurrentEvent.GetComponent <EventBase>().Description;
            Option1.GetComponentInChildren <Text>().text = CurrentEvent.transform.GetChild(0).GetComponent <EventOption>().Description;
            Option2.GetComponentInChildren <Text>().text = CurrentEvent.transform.GetChild(1).GetComponent <EventOption>().Description;
            Option3.GetComponentInChildren <Text>().text = CurrentEvent.transform.GetChild(2).GetComponent <EventOption>().Description;

            if (Option3.GetComponentInChildren <Text>().text == "")
            {
                Option3.SetActive(false);
            }

            if (Option2.GetComponentInChildren <Text>().text == "")
            {
                Option2.SetActive(false);
            }

            if (Option1.GetComponentInChildren <Text>().text == "")
            {
                Option1.SetActive(false);
                CurrentEvent.transform.GetChild(0).gameObject.GetComponent <EventOption>().DoEffect();
                CurrentStage = EVENT_STAGE.OUTCOME;
            }

            if (i_ChosenOption != 0)
            {
                CurrentEvent.transform.GetChild(i_ChosenOption - 1).gameObject.GetComponent <EventOption>().DoEffect();
                SelectedOption = CurrentEvent.transform.GetChild(i_ChosenOption - 1).gameObject;

                CurrentStage = EVENT_STAGE.OUTCOME;
            }
            break;

        case EVENT_STAGE.OUTCOME:

            if (SelectedOption)
            {
                Description.text = SelectedOption.GetComponent <EventOption>().GetSelectedOutcome().GetComponent <EventOutcome>().Description;
            }

            Option1.SetActive(false);
            Option2.SetActive(false);
            Option3.SetActive(false);
            EndButton.SetActive(true);

            Destroy(CurrentEvent);

            break;
        }
    }