private void Awake() { Instance = this; rectTransform = GetComponent <RectTransform>(); gameObject.SetActive(false); moveTimer = new CountDownTimer(moveDuration, false, false); }
void bgWorker_ProgressChanged(object sender, ProgressChangedEventArgs e) { if (PBCountDown.Maximum == e.ProgressPercentage) { if (yourturn == true) { if (OPlayerCard.Count == 0) { CardChoose.Clear(); CardChoose.Add(MyCard.First()); tcpForPlayer.SendData("|" + MyCard.First().GetName()); MyCard.Remove(MyCard.First()); SeperateData(CardChoose, CardHavePlay); SeperateData(MyCard, CardButton); } else { tcpForPlayer.SendData("Skip"); } yourturn = false; label2.Text = ""; CountDownTimer.Stop(); PBCountDown.Visible = false; } } }
private void CountDownTimer_Tick(object sender, EventArgs e) { if (CountDown >= 120) { CountDownTimer.Stop(); Tijd.Text = " BETS CLOSED 0:00"; } else { string seconde; CountDown++; int huidigtijd = 120 - CountDown; int min = huidigtijd / 60; int sec = huidigtijd - (60 * min); if (sec < 10) { seconde = "0" + Convert.ToString(sec); } else { seconde = Convert.ToString(sec); } string minuut = Convert.ToString(min); Tijd.Text = Convert.ToString(" BETS OPEN " + minuut + ":" + seconde); } }
private void CountDownTimer_Tick(object sender, EventArgs e) { if (PBCountDown.Maximum - 100 == PBCountDown.Value) { if (OPlayerCard.Count == 0) { CardChoose.Clear(); CardChoose.Add(MyCard.First()); tcpForPlayer.SendData("|" + MyCard.First().GetName()); MyCard.Remove(MyCard.First()); SeperateData(CardChoose, CardHavePlay); SeperateData(MyCard, CardButton); } else { tcpForPlayer.SendData("Skip"); } yourturn = false; label2.Text = ""; CountDownTimer.Stop(); PBCountDown.Value = 0; PBCountDown.Visible = false; } else { PBCountDown.PerformStep(); } }
private void Init_CDTimer() { CDTimer = new CountDownTimer(59, 59); Digit_clock.Text = $"00:00"; CDTimer.TimeChanged += () => Digit_clock.Text = CDTimer.TimeLeftMsStr; CDTimer.CountDownFinished += new Action(Work_count_down_finished); }
public VideoSuscribeWindow(GUISkin skin, RoomVariableManager rvm, Texture2D videoDef, Texture2D videoTimeOut) { gSkin = skin; RoomVariableMgr = rvm; windowsCreated = false; adviceMessage = "No se selecciono usuario"; endSuscriptionMessage = "Terminar suscripcion"; endSuscriptionQuestion = "Desea terminar la suscripcion?"; videoFrame = new VidFrame(false); videoRunning = false; adviceWindowOn = false; closeQuestionOn = false; totalWidth = 500; menuWidth = totalWidth/3; listWidth = totalWidth-menuWidth; totalHeight = 400; conectionsList = new List<GUIContent>(); userScrollPosition = Vector2.zero; conectionScrollPosition = Vector2.zero; selectedConection = -1; tempSelectedConection = -1; selectedUser = -1; tempSelectedUser = -1; videoDefault = videoDef; enableWindow = false; timedOut = false; videoTimedOut = videoTimeOut; countDownTimer = new CountDownTimer(10); }
protected void deleteMail_Click(object sender, EventArgs e) { // request to ZOHO to delete email alias var client = new RestClient("https://mail.zoho.eu/api/organization/20070562961/accounts/20070563172"); client.Timeout = -1; var request = new RestRequest(Method.PUT); request.AddHeader("Authorization", "Zoho-oauthtoken " + Session["access_token"]); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\r\n \"zuid\": \"20070563172\",\r\n \"mode\": \"deleteEmailAlias\",\r\n \"emailAlias\": [\r\n \"" + Session["email"] + "\"\r\n ]\r\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); //clicking this button will also clear messages clearMessages_Click(sender, e); // we cannot see these buttons updateMessages.Visible = false; updateMail.Visible = false; clearMessages.Visible = false; deleteMail.Visible = false; sendMessage.Visible = false; Mail.Text = ""; Timer.Text = ""; Timer.Visible = false; Session["access_token"] = null; Session["email"] = null; Session["CountdownTimer"] = new CountDownTimer(TimeSpan.Parse("00:00:00")); //but we can again click "Generate" Generate.Enabled = true; }
private void button3_Click(object sender, EventArgs e) { Process.Start("Chrome.exe", @"C:\Users\mussa\source\repos\CryptoQuest\CryptoQuest\Resources\HTMLPage1.html"); label3.Visible = true; label2.Visible = true; button1.Visible = true; pictureBox1.Visible = true; button3.Visible = false; label5.Visible = true; textBox1.Enabled = true; button2.Enabled = true; CountDownTimer timer = new CountDownTimer(); //set to 30 mins timer.SetTime(5, 0); timer.Start(); //update label text timer.TimeChanged += () => label5.Text = timer.TimeLeftMsStr; // show messageBox on timer = 00:00.000 timer.CountDownFinished += () => MessageBox.Show("Уақыт бітті кеңес алуыңызға болады!"); //timer step. By default is 1 second timer.StepMs = 33; timer.CountDownFinished += () => label4.Visible = true; timer.CountDownFinished += () => button4.Visible = true; timer.CountDownFinished += () => label5.Visible = false; }
void Start() { playerSkill = this.GetComponent <PlayerSkill>(); Application.targetFrameRate = 60; _mainView = GameObject.Find("UIPanel").GetComponent <UIPanel>().ui; _list = _mainView.GetChild("mailList").asList; delayAttack = 100; //Declare delay 100 sec calAttackSpeed(); for (int i = 0; i < 7; i++) { CountDownTimer cdTimer = new CountDownTimer(HeroStatus.instance.used_activeskill[i].cd); if (cdTimers.ContainsKey(HeroStatus.instance.used_activeskill[i].skillID)) { } else { cdTimers.Add(key: HeroStatus.instance.used_activeskill[i].skillID, value: cdTimer); HeroStatus.instance.used_activeskill[i].cdCount = cdTimer; } } }
public void StartRandomTimer() { if (IsRunning) { Log.Debug($"Timer already running"); return; } Log.Debug($"Random start triggered at {DateTime.Now}"); IsRunning = true; var minimum = _propertyService.MinimumDelay; var window = minimum + _propertyService.StartWindow; Starting?.Invoke(this, EventArgs.Empty); var sleep = _random.Next(minimum, window); Log.Information($"Sleeping for {sleep}ms"); var timer = new CountDownTimer(TimeSpan.FromMilliseconds(sleep)); timer.ReachedZero += (_, __) => { Log.Information($"Start!"); Started?.Invoke(this, EventArgs.Empty); IsRunning = false; }; timer.Start(); }
public BossAttack(string name, Vector2 size, Vector2 origin, Vector2 velocity) : base(name, size) { SetOrigin(origin); mVelocity = Vector2.Normalize(velocity); mSpeed = 800; mTimer = new CountDownTimer(0.8f); }
void Start() { _mainView = GameObject.Find("UIPanel").GetComponent <UIPanel>().ui; _list = _mainView.GetChild("mailList").asList; playerSkill = GameObject.Find("enemy(Clone)").GetComponent <EnemySkill>(); //questData = GameObject.Find("QuestData").GetComponent<Quest_Data>(); //攻击间隔 = 基础攻击间隔 + 最大攻击间隔 * (1 - (敏捷)/(敏捷+加成系数)) calAttackSpeed();//Declare delay 100 sec for (int i = 0; i < 7; i++) { CountDownTimer cdTimer_enemy = new CountDownTimer(EnemyStatus.instance.used_activeskill[i].cd); if (cdTimers_enemy.ContainsKey(EnemyStatus.instance.used_activeskill[i].skillID)) { } else { cdTimers_enemy.Add(key: EnemyStatus.instance.used_activeskill[i].skillID, value: cdTimer_enemy); EnemyStatus.instance.used_activeskill[i].cdCount = cdTimer_enemy; } } }
//public delegate void TriggerGameOver(); //public TriggerGameOver GameOverTrigger; // Start is called before the first frame update void Start() { Instance = this; TimerNum = GetComponent <Text>(); CountDownTimer.GetInstance().CountDown("main_timer", 60f, (t) => { TimerNum.text = string.Format("{0:0}", t); }, () => { Debug.Log("time is up"); if (ScoreManager.Instance.GetScore() > 70) { Game.GetInstance().ToHighScore(); //SceneManager.LoadScene("HighScore"); } else if (ScoreManager.Instance.GetScore() < 30) { Game.GetInstance().ToLowScore(); //SceneManager.LoadScene("LowScore"); } else { Game.GetInstance().ToMidScore(); //SceneManager.LoadScene("MidScore"); } CountDownTimer.GetInstance().ClearAllTimers(); }); }
private void Start() { _countDownTimer = CanvasManager.Instance.CountDownTimer; //при старте записываем обьект head, чтобы мы его могли использовать в дальнейшем для проверки конца игры Head = Body[1].Rigidbody; }
public void goToDeath() { if (isDead) { return; } isDead = true; playerScoreText.GetComponent <Text>().color = Color.red; playerScoreText.parent = transform.parent; BattlefieldUI.deadPlayerNo++; if (isLocalPlayer && NetworkUI.networkUI.transform_CoverController) { Destroy(NetworkUI.networkUI.transform_CoverController.gameObject); } int childCount = transform.childCount; for (int i = 0; i < childCount; i++) { Destroy(transform.GetChild(i).gameObject); } if (BattlefieldUI.deadPlayerNo == BattlefieldUI.playerNo) { cdTimer = null; cdTimer_been = null; Debug.Log("游戏结束"); AudioManager.Instance.PlaySound(1); NetworkUI.gameOver(); } }
protected new void OnEnable() { base.OnEnable(); timer = new CountDownTimer(delayTime, false, true); blinkLength = 1f / blinkTimes; StartCoroutine(CrashCoroutine()); }
public override void onResume() { base.onResume(); countDownTimer = new CountDownTimerAnonymousInnerClassHelper(this, long.MaxValue) .start(); }
// Use this for initialization void Start() { textUI = GetComponent <Text>(); countdowntimer = GetComponent <CountDownTimer>(); StartFading(startSeconds); }
private void OnPlayerStateUpdate(object sender, PlayerStateChangedEventArgs eventArgs) { NotifyPropertyChanged("MultimediaName"); NotifyPropertyChanged("MultimediaLength"); NotifyPropertyChanged("Playing"); NotifyPropertyChanged("PlaybackPosition"); NotifyPropertyChanged("PlaybackTime"); MultimediaItem multimedia = eventArgs.Multimedia; if (eventArgs.Multimedia != null) { this.millisLength = (long)multimedia.Length * 1000; long millisEstimatedLength = millisLength - (eventArgs.PlaybackPosition * 1000); int millisStep = 1000 / 60; if (playbackUpdater != null) { playbackUpdater.Cancel(); } playbackUpdater = new CountDownTimer(new DispatcherMessageQueue(), millisEstimatedLength, millisStep); playbackUpdater.Tick += OnUpdaterTick; playbackUpdater.Finish += OnUpdaterFinish; playbackUpdater.Start(); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["CountdownTimer"] == null) { Session["CountdownTimer"] = new CountDownTimer(TimeSpan.Parse("2:30:00")); (Session["CountdownTimer"] as CountDownTimer).Start(); } }
/// <summary> /// Constructor to initialize the HUD /// </summary> /// <param name="sb">The sprite batch use draw with</param> public HUD(SpriteBatch sb) { batch = sb; Score = "Score "; TimeLeft = " Time left "; HUDString = ""; timer = new CountDownTimer(); }
public static CountDownTimer GetInstance() { if (Instance == null) { Instance = new CountDownTimer(); } return(Instance); }
void Start() { og = ObjectGenerator.GetComponent <ObjectGenerator>(); cdTimer = timerPanelText.GetComponent <CountDownTimer>(); oldEnemyKillFlg = enemyKillFlg; audioSource = this.GetComponent <AudioSource>(); }
public void StartGameTimer() { if (_gameTimer == null) { _gameTimer = gameObject.AddComponent <CountDownTimer>(); } _gameTimer.StartTimer(_renderData.GameService.GameTime, UpdateGameTimer, FinishGameTimer); }
void Start() { timer = GetComponent <CountDownTimer>(); character = GameObject.FindGameObjectWithTag("Player").GetComponent <ThirdPersonCharacter>(); playerRigidbody = GameObject.FindGameObjectWithTag("Player").GetComponent <Rigidbody>(); gameManager = GameObject.Find("GameManager").GetComponent <GameManager>(); StartCoroutine(ReadyGo()); }
private void Start() { _countDownTimer = FindObjectOfType <CountDownTimer>(); _canvasManager = FindObjectOfType <CanvasManager>(); _gamemanager = FindObjectOfType <GameManager>(); //при старте записываем обьект head, чтобы мы его могли использовать в дальнейшем для проверки конца игры Head = Body[1].Rigidbody; }
private void Awake() { if (Instance) { Destroy(Instance.gameObject); } Instance = this; }
/// <summary> /// 清除信息 /// </summary> private void Clean() { timer = null; foreach (var item in propPointDict) { item.Key.gameObject.SetActive(false); } propPointDict.Clear(); }
public GamePlay(Timer scoreTimer) { isEndFlag = false; var gameDevice = GameDevice.Instance(); sound = gameDevice.GetSound(); this.scoreTimer = scoreTimer; limitTimer = new CountDownTimer(60.0f); }
protected void loadPage() { //DAO dao = new DAO(); int testNumber = int.Parse(Request["IDQUIZDO"]); // aaa.Show(testNumber + ""); Session["TESTID"] = testNumber; int[] allQuiz = tDAO.getAllQuizOfTest(testNumber); //aaa.Show(allQuiz.Length + ""); int largestQuizID = tDAO.getLargestQuizIdOfTest(testNumber); //aaa.Show(largestQuizID + ""); //for (int i = 0; i < allQuiz.Length; i++) //{ // Label3.Text += allQuiz[i] + " "; //} //Label1.Text = "Num of Quiz: " + allQuiz.Length + " Thu tu: "; //Label1.Text = largestQuizID + ""; var numbers = new List <int>(); var number = ran.Next(1, largestQuizID); while (numbers.Count < 20) { //Nếu list chưa đủ 20 phần tử do { number = ran.Next(1, largestQuizID); } while (numbers.Contains(number) || !allQuiz.Contains(number)); numbers.Add(number); //Khi đã random được ra 1 số chưa có trong list thì add nó vào list Label1.Text += number + " "; } for (int i = 0; i < 20; i++) { list.Add(qDAO.getQuizDetail(numbers[i])); } RadioButtonList[] rbList = { RadioButtonList1, RadioButtonList2, RadioButtonList3, RadioButtonList4, RadioButtonList5, RadioButtonList6, RadioButtonList7, RadioButtonList8, RadioButtonList9, RadioButtonList10, RadioButtonList11, RadioButtonList12, RadioButtonList13, RadioButtonList14, RadioButtonList15, RadioButtonList16, RadioButtonList17, RadioButtonList18, RadioButtonList19, RadioButtonList20 }; Label[] labeAnswerList = { a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20 }; Label[] labelQuestionList = { q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11, q12, q13, q14, q15, q16, q17, q18, q19, q20 }; Label[] labeQuestionIDList = { aID1, aID2, aID3, aID4, aID5, aID6, aID7, aID8, aID9, aID10, aID11, aID12, aID13, aID14, aID15, aID16, aID17, aID18, aID19, aID20 }; for (int i = 0; i < 20; i++) { string[] answer = null; labelQuestionList[i].Text = "Quiz " + (i + 1) + ": (Detail)" + list[i].QuizDetails; labeAnswerList[i].Text = list[i].CorrectAnswer; labeAnswerList[i].Visible = false; labeQuestionIDList[i].Text = list[i].QuizID + ""; labeQuestionIDList[i].Visible = false; answer = qDAO.getAllAnswerOfQuiz(numbers[i]); loadAnswer(rbList[i], answer); } if (Session["CountdownTimer"] == null) { Session["CountdownTimer"] = new CountDownTimer(TimeSpan.Parse("00:30:00")); (Session["CountdownTimer"] as CountDownTimer).Start(); } }
// Use this for initialization void Start() { CDTscript = timer.GetComponent <CountDownTimer>(); tcSctipt = unityChan.GetComponent <TreasureCountScript>(); foreach (Transform child in transform) { child.gameObject.SetActive(false); } }
void Awake() { if (isTimed) { myCountDownTimerRef = GameObject.Find("TimerLabel").GetComponent<CountDownTimer>(); } myLevelStatsRef = this.gameObject.GetComponent<LevelStats>(); // Automatic find game objects and references myDrinksContainerRef = GameObject.Find("_DrinksContainer").GetComponent<DrinksContainer>(); mySeatsRef = GameObject.Find("_Seats").GetComponent<Seats>(); drinkSpawner = GameObject.Find("DrinkSpawner").transform; }
public override void onResume() { base.onResume(); countDownTimer = new CountDownTimerAnonymousInnerClassHelper(this, long.MaxValue) .start(); }
void Awake() { if (timer == null) { timer = this; } }
public override void AwakeFromNib () { GrowlApplicationBridge.WeakDelegate = this; counter = new CountDownTimer (); Bind ("countDown", counter, "timeLeft", null); }
// Use this for initialization void Start() { instance = this; }