Пример #1
0
    public void CountTime()
    {
        Count     -= Time.deltaTime;
        CountInt   = (int)Count;
        Timer.text = CountInt.ToString();

        if (CountInt == 0 || p2Lose || p1Lose)
        {
            winnercheck();


            if (checknumber)
            {
                Count = 20;
                HealthBarP1.Health = 120;
                HealthBarP2.Health = 120;
                RoundNumber[i].SetActive(true);

                StartCoroutine(Rounds());
                TimerO.SetActive(false);

                Destroy(Player2);
                Destroy(Player1);

                Debug.Log("cro");
            }
        }
    }
Пример #2
0
        public void IntCount()
        {
            CountInt intCount = new CountInt();
            Dictionary <int, int> expected = new Dictionary <int, int>()
            {
                { 1, 2 },
                { 44, 1 },
                { 55, 1 },
                { 63, 3 },
                { 77, 1 },
                { 99, 2 }
            };

            CollectionAssert.AreEqual(expected, intCount.IntCount(new int[] { 1, 99, 63, 1, 55, 77, 63, 99, 63, 44 }));
        }
 private void PMainForm_Load(object sender, EventArgs e)
 {
     Resol = "######";
     //WDTF=new WriteDataToFile();
     WKL  = new WorkLogic(Application.StartupPath);
     sett = new Setting(WKL);
     //timer1.Start();
     WKL.GlobalTimeTicTac    += WKL_GlobalTimeTicTac;
     WKL.InitEvent           += () => { P_TSB_GO.Enabled = true; };
     WKL.StartEvent          += WKL_StartEvent;
     WKL.MeasCountTimerEvent += (int CountInt) => PTSL_CountTime.Text = CountInt.ToString();
     WKL.ActionEvent         += WKL_ActionEvent;
     WKL.StopEvent           += WKL_StopEvent;
     WKL.PauseEvent          += () => { P_TSB_Pause.Enabled = false; P_TSB_GO.Enabled = true; };
     sett.SplineChange       += (bool Sp) => { PDataChart.Series[0].ChartType = Sp ? SeriesChartType.Spline : SeriesChartType.Line; };
     sett.ResolChange        += (int Res) => { Resol = MakeString(Res); };
 }
Пример #4
0
    public IEnumerator Rounds()
    {
        yield return(new WaitForSeconds(4f));

        RoundNumber[i].SetActive(false);
        i++;
        Count = 100;
        TimerO.SetActive(true);

        Count             -= Time.deltaTime;
        Timer.text         = CountInt.ToString();
        HealthBarP1.Health = 120;
        HealthBarP2.Health = 120;
        Gamemanager.InstantiatesAi();
        HUD1.SetActive(true);
        HUD2.SetActive(true);
        triangle.SetActive(true);
        counter.SetActive(true);

        EndAnim = true;
        RoundN  = true;
    }