public void StartWaves() { waveIdx = 0; numEnemies = GetNumEnemies(waves[0]); numKilled = 0; onWaveStart.Invoke(timeBeforeNextWave, waves[waveIdx], home); Invoke("UpdateWave", timeBeforeNextWave); }
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; } }; }
/// <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()); } }); }
public void Start() { StartEvent?.Invoke(this.Cosmonauts); timer.Interval = 20; timer.AutoReset = true; timer.Elapsed += new System.Timers.ElapsedEventHandler(Tick); timer.Start(); }
private void Start() { StartEvent.Invoke(); if (SolvedPuzzle.value) { IfSolvedPuzzle.Invoke(); } }
public void Continue() { if (IsRunning) { return; } _isRunning = true; StartEvent?.Invoke(this, EventArgs.Empty); }
public void StartGame(string nickname) { _player = nickname; if (_resetOnNewGame) { _score.Value = 0; } StartEvent?.Invoke(); }
public virtual void Start() { OnStart?.Invoke(); foreach (Actor child in _children) { child.Start(); } Started = true; }
private void Update() { if (!Input.GetKey(KeyCode.Space) || !enableStart) { return; } startText.gameObject.SetActive(false); enableStart = false; StartEvent?.Invoke(); StartCoroutine(RunStartWait()); }
/// <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(); }
public void Start(float timerSeconds) { if (IsRunning) { return; } _timerSeconds = timerSeconds; _secondsRemaining = TimerSeconds; _isRunning = true; StartEvent?.Invoke(this, EventArgs.Empty); }
public void Start(IntRangeConfig timerSeconds) { if (IsRunning) { return; } _timerSeconds = timerSeconds.GetRandomValue(); _secondsRemaining = TimerSeconds; _isRunning = true; StartEvent?.Invoke(this, EventArgs.Empty); }
/// <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; } }
//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; }
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); }
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); } }
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(); } }
// 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; }
private void Start() { startEvent.Invoke(); }
private void StartButtonClicked(object sender, RoutedEventArgs e) { StartEvent.Invoke(sender, e); }
protected virtual void OnStart(StartEventArgs ses) { Console.WriteLine($"{ses.SpiderInfo}初始化完毕"); StartEvent?.Invoke(this, ses); }
private void Start() { StartEvent?.Invoke(); }
protected void OnStart() { StartEvent?.Invoke(this); }
private void StartGameJump() { _StartEvent.Invoke(_PlayerTransform, MoveToPosition.position + new Vector3(0, 0.2f, 0), time); Sound.Play(); }
void Start() { OnGameStart.Invoke(); }
void Start() { onTrigger.Invoke(gameObject); }
private void AriClientOnStasisStartEvent(IAriClient sender, StasisStartEvent e) { StartEvent?.Invoke(this, e); }
protected void OnStartEvent(EventArgs e) { StartEvent?.Invoke(this, e); }
protected virtual void OnStartEvent() { StartEvent?.Invoke(this, EventArgs.Empty); }
private void startToolStripMenuItem_Click(object sender, EventArgs e) { StartEvent?.Invoke(this, e); }