public void StartWaves()
 {
     waveIdx    = 0;
     numEnemies = GetNumEnemies(waves[0]);
     numKilled  = 0;
     onWaveStart.Invoke(timeBeforeNextWave, waves[waveIdx], home);
     Invoke("UpdateWave", timeBeforeNextWave);
 }
Ejemplo n.º 2
0
 void Start()
 {
     if (ToCam == null)
     {
         ToCam = Camera.main;
     }
     onPress += (go, state) => {
         Open = state;
         if (state)
         {
             StartV2 = GetV2(Input.mousePosition);
             StartEvent.Invoke();
         }
         else
         {
             if (!Out)
             {
                 EndEvent.Invoke();
             }
             else
             {
                 Father.onPress(Father.gameObject, false);
             }
             Out = false;
         }
     };
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 准备
 /// </summary>
 /// <param name="clientPeer"></param>
 private void ready(ClientPeer clientPeer)
 {
     SingleExcute.Instance.Excute(() =>
     {
         if (!accountCache.IsOnline(clientPeer))
         {
             return;
         }
         int accid = accountCache.GetId(clientPeer);
         if (!userModelCache.IsExistUserModel(accid))
         {
             return;
         }
         int uid             = userModelCache.GetModelByAccid(accid).Id;
         RoomModel roomModel = roomCache.GetRoomModelByUid(uid);
         roomModel.Ready(uid);
         roomModel.Brocast(uid, clientPeer, OpCode.MATCH, MatchCode.READY_BRO);
         //判断是否所有玩家都已经准备
         if (roomModel.IsAllReady())
         {
             //向客户端发送开始游戏的响应
             roomModel.Brocast(null, null, OpCode.MATCH, MatchCode.START_BRO);
             StartEvent.Invoke(roomModel.GetAllReadyUserIdInRoom());
         }
     });
 }
Ejemplo n.º 4
0
 public void Start()
 {
     StartEvent?.Invoke(this.Cosmonauts);
     timer.Interval  = 20;
     timer.AutoReset = true;
     timer.Elapsed  += new System.Timers.ElapsedEventHandler(Tick);
     timer.Start();
 }
Ejemplo n.º 5
0
 private void Start()
 {
     StartEvent.Invoke();
     if (SolvedPuzzle.value)
     {
         IfSolvedPuzzle.Invoke();
     }
 }
Ejemplo n.º 6
0
            public void Continue()
            {
                if (IsRunning)
                {
                    return;
                }
                _isRunning = true;

                StartEvent?.Invoke(this, EventArgs.Empty);
            }
Ejemplo n.º 7
0
    public void StartGame(string nickname)
    {
        _player = nickname;

        if (_resetOnNewGame)
        {
            _score.Value = 0;
        }
        StartEvent?.Invoke();
    }
Ejemplo n.º 8
0
        public virtual void Start()
        {
            OnStart?.Invoke();

            foreach (Actor child in _children)
            {
                child.Start();
            }

            Started = true;
        }
Ejemplo n.º 9
0
 private void Update()
 {
     if (!Input.GetKey(KeyCode.Space) || !enableStart)
     {
         return;
     }
     startText.gameObject.SetActive(false);
     enableStart = false;
     StartEvent?.Invoke();
     StartCoroutine(RunStartWait());
 }
Ejemplo n.º 10
0
        /// <summary>
        /// 启动,完成后引发StartEvent
        /// </summary>
        /// <param name="port">服务端口</param>
        public virtual void Start(int port)
        {
            var task = new Task(async() =>
            {
                string result = await CreateMQTTServer(port);
                Console.Title = $"0.0.0.0:{port}";
                StartEvent?.Invoke(result);
            });

            task.Start();
        }
Ejemplo n.º 11
0
            public void Start(float timerSeconds)
            {
                if (IsRunning)
                {
                    return;
                }

                _timerSeconds     = timerSeconds;
                _secondsRemaining = TimerSeconds;
                _isRunning        = true;

                StartEvent?.Invoke(this, EventArgs.Empty);
            }
Ejemplo n.º 12
0
            public void Start(IntRangeConfig timerSeconds)
            {
                if (IsRunning)
                {
                    return;
                }

                _timerSeconds     = timerSeconds.GetRandomValue();
                _secondsRemaining = TimerSeconds;
                _isRunning        = true;

                StartEvent?.Invoke(this, EventArgs.Empty);
            }
Ejemplo n.º 13
0
 /// <summary>
 /// 启动按钮
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Start_Click(object sender, EventArgs e)
 {
     if (running)//运行中
     {
         return;
     }
     else
     {
         Start.Enabled        = false;
         SelectMethod.Enabled = false;
         StartEvent?.Invoke();
         running = true;
     }
 }
Ejemplo n.º 14
0
        //Call the OnStart events of the Actor and its children
        public virtual void Start()
        {
            //Call this Actor's OnStart events
            OnStart?.Invoke();

            //Start all of this Actor's children
            foreach (Actor child in _children)
            {
                child.Start();
            }

            //Flag this Actor as having already started
            Started = true;
        }
Ejemplo n.º 15
0
        public static void PerformInstall(List <Package> paks)
        {
            if (paks == null || paks.Count < 1)
            {
                Log.Write("List<Package> is null or empty.");
                return;
            }
            if (worker.IsBusy)
            {
                Log.Write("Tried to start install while install was in progress.");
                return;
            }

            StartEvent.Invoke(null, null);
            worker.RunWorkerAsync(paks);
        }
Ejemplo n.º 16
0
        private void downloadThread()
        {
            try
            {
                Uri            URL            = new Uri(httpUrl);
                HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(URL);
                httpWebRequest.Timeout = 120 * 1000;
                HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();


                long totalBytes = httpWebResponse.ContentLength;
                //更新文件大小
                StartEvent?.Invoke(this, totalBytes);
                Stream st = httpWebResponse.GetResponseStream();
                Stream so = new FileStream(savePath, FileMode.Create);

                long   totalDownloadedByte = 0;
                byte[] by    = new byte[1024];
                int    osize = st.Read(by, 0, (int)by.Length);
                while (osize > 0)
                {
                    totalDownloadedByte = osize + totalDownloadedByte;
                    so.Write(by, 0, osize);

                    osize = st.Read(by, 0, (int)by.Length);

                    //进度计算
                    double process = double.Parse(String.Format("{0:F}",
                                                                ((double)totalDownloadedByte / (double)totalBytes * 100)));
                    ProcessUpdateEvent?.Invoke(this, process);
                }
                //关闭资源
                httpWebResponse.Close();
                so.Close();
                st.Close();
                CompleteEvent?.Invoke(this, null);
            }
            catch (Exception ec)
            {
                LogHelper.Warning(ec.ToString());

                //下载发生异常
                ErrorEvent?.Invoke(this, ec.Message);
            }
        }
Ejemplo n.º 17
0
 private void startButton_Click(object sender, EventArgs e)
 {
     if (!Directory.Exists(sourcePath))
     {
         MessageBox.Show("A valid source path must be chosen");
     }
     else if (!Directory.Exists(targetPath))
     {
         MessageBox.Show("A valid target path must be chosen.");
     }
     else if (numThreads == 0)
     {
         MessageBox.Show("A valid number of threads must be chosen.");
     }
     else
     {
         StartEvent?.Invoke();
     }
 }
Ejemplo n.º 18
0
    // Start is called before the first frame update
    void Awake()
    {
        Properties       = properties;
        PlayerController = InitSystem <PlayerController>();
        GameCharacter    = InitSystem <GameCharacterSystem>();
        ObjectSpawner    = InitSystem <ObjectSpawner>();
        Projectiles      = InitSystem <ProjectileSystem>();
        Colliders        = InitSystem <CollidersSystem>();
        NpcSystem        = InitSystem <NpcSystem>();
        RespawnSystem    = InitSystem <RespawnSystem>();
        VFX = InitSystem <VfxSystem>();


        systems.ForEach(system => system.Init());
        systems.ForEach(system => system.Start());
        GameStarted = true;
        StartEvent?.Invoke();
        Cursor.visible   = false;
        Cursor.lockState = CursorLockMode.Confined;
    }
Ejemplo n.º 19
0
 private void Start()
 {
     startEvent.Invoke();
 }
Ejemplo n.º 20
0
 private void StartButtonClicked(object sender, RoutedEventArgs e)
 {
     StartEvent.Invoke(sender, e);
 }
Ejemplo n.º 21
0
 protected virtual void OnStart(StartEventArgs ses)
 {
     Console.WriteLine($"{ses.SpiderInfo}初始化完毕");
     StartEvent?.Invoke(this, ses);
 }
Ejemplo n.º 22
0
 private void Start()
 {
     StartEvent?.Invoke();
 }
Ejemplo n.º 23
0
 protected void OnStart()
 {
     StartEvent?.Invoke(this);
 }
Ejemplo n.º 24
0
 private void StartGameJump()
 {
     _StartEvent.Invoke(_PlayerTransform, MoveToPosition.position + new Vector3(0, 0.2f, 0), time);
     Sound.Play();
 }
Ejemplo n.º 25
0
 void Start()
 {
     OnGameStart.Invoke();
 }
Ejemplo n.º 26
0
 void Start()
 {
     onTrigger.Invoke(gameObject);
 }
 private void AriClientOnStasisStartEvent(IAriClient sender, StasisStartEvent e)
 {
     StartEvent?.Invoke(this, e);
 }
Ejemplo n.º 28
0
 protected void OnStartEvent(EventArgs e)
 {
     StartEvent?.Invoke(this, e);
 }
Ejemplo n.º 29
0
 protected virtual void OnStartEvent()
 {
     StartEvent?.Invoke(this, EventArgs.Empty);
 }
Ejemplo n.º 30
0
 private void startToolStripMenuItem_Click(object sender, EventArgs e)
 {
     StartEvent?.Invoke(this, e);
 }