コード例 #1
0
 public void StartWaves()
 {
     waveIdx    = 0;
     numEnemies = GetNumEnemies(waves[0]);
     numKilled  = 0;
     onWaveStart.Invoke(timeBeforeNextWave, waves[waveIdx], home);
     Invoke("UpdateWave", timeBeforeNextWave);
 }
コード例 #2
0
ファイル: DragButt_t.cs プロジェクト: tommyboys0107/2018gcgj
 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;
         }
     };
 }
コード例 #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());
         }
     });
 }
コード例 #4
0
 public void Start()
 {
     StartEvent?.Invoke(this.Cosmonauts);
     timer.Interval  = 20;
     timer.AutoReset = true;
     timer.Elapsed  += new System.Timers.ElapsedEventHandler(Tick);
     timer.Start();
 }
コード例 #5
0
 private void Start()
 {
     StartEvent.Invoke();
     if (SolvedPuzzle.value)
     {
         IfSolvedPuzzle.Invoke();
     }
 }
コード例 #6
0
ファイル: TimeManager.cs プロジェクト: pdxparrot/ssj2019
            public void Continue()
            {
                if (IsRunning)
                {
                    return;
                }
                _isRunning = true;

                StartEvent?.Invoke(this, EventArgs.Empty);
            }
コード例 #7
0
    public void StartGame(string nickname)
    {
        _player = nickname;

        if (_resetOnNewGame)
        {
            _score.Value = 0;
        }
        StartEvent?.Invoke();
    }
コード例 #8
0
        public virtual void Start()
        {
            OnStart?.Invoke();

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

            Started = true;
        }
コード例 #9
0
 private void Update()
 {
     if (!Input.GetKey(KeyCode.Space) || !enableStart)
     {
         return;
     }
     startText.gameObject.SetActive(false);
     enableStart = false;
     StartEvent?.Invoke();
     StartCoroutine(RunStartWait());
 }
コード例 #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();
        }
コード例 #11
0
ファイル: TimeManager.cs プロジェクト: pdxparrot/ssj2019
            public void Start(float timerSeconds)
            {
                if (IsRunning)
                {
                    return;
                }

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

                StartEvent?.Invoke(this, EventArgs.Empty);
            }
コード例 #12
0
ファイル: TimeManager.cs プロジェクト: pdxparrot/ssj2019
            public void Start(IntRangeConfig timerSeconds)
            {
                if (IsRunning)
                {
                    return;
                }

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

                StartEvent?.Invoke(this, EventArgs.Empty);
            }
コード例 #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;
     }
 }
コード例 #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;
        }
コード例 #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);
        }
コード例 #16
0
ファイル: HttpDownload.cs プロジェクト: xiaohszx/ProjectEye
        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);
            }
        }
コード例 #17
0
ファイル: MainForm.cs プロジェクト: doughtnerd/ImageSorter
 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();
     }
 }
コード例 #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;
    }
コード例 #19
0
 private void Start()
 {
     startEvent.Invoke();
 }
コード例 #20
0
 private void StartButtonClicked(object sender, RoutedEventArgs e)
 {
     StartEvent.Invoke(sender, e);
 }
コード例 #21
0
ファイル: CerSpiderBase.cs プロジェクト: MwtFirstGit/fangtai
 protected virtual void OnStart(StartEventArgs ses)
 {
     Console.WriteLine($"{ses.SpiderInfo}初始化完毕");
     StartEvent?.Invoke(this, ses);
 }
コード例 #22
0
 private void Start()
 {
     StartEvent?.Invoke();
 }
コード例 #23
0
 protected void OnStart()
 {
     StartEvent?.Invoke(this);
 }
コード例 #24
0
ファイル: MenuJumper.cs プロジェクト: Teodil/DoodleJumpParody
 private void StartGameJump()
 {
     _StartEvent.Invoke(_PlayerTransform, MoveToPosition.position + new Vector3(0, 0.2f, 0), time);
     Sound.Play();
 }
コード例 #25
0
 void Start()
 {
     OnGameStart.Invoke();
 }
コード例 #26
0
ファイル: StartTrigger.cs プロジェクト: te-program/test
 void Start()
 {
     onTrigger.Invoke(gameObject);
 }
コード例 #27
0
 private void AriClientOnStasisStartEvent(IAriClient sender, StasisStartEvent e)
 {
     StartEvent?.Invoke(this, e);
 }
コード例 #28
0
 protected void OnStartEvent(EventArgs e)
 {
     StartEvent?.Invoke(this, e);
 }
コード例 #29
0
 protected virtual void OnStartEvent()
 {
     StartEvent?.Invoke(this, EventArgs.Empty);
 }
コード例 #30
0
ファイル: Form.cs プロジェクト: vitalist82/flowchecker
 private void startToolStripMenuItem_Click(object sender, EventArgs e)
 {
     StartEvent?.Invoke(this, e);
 }