// void Update() { if (started) { delayCounter = MathfPlus.DecByDeltatimeToZero(delayCounter); if (delayCounter == 0) { nowKill = true; started = false; shouldCountStop = true; } } if (shouldCountStop) { stopTimeCounter = MathfPlus.DecByDeltatimeToZero(stopTimeCounter); if (stopTimeCounter == 0) { nowKill = false; shouldCountStop = false; } } }
void Update() { if (step == 1) { int rnd = Random.Range(0, mortarManagers.Length); selectedMrtMg = mortarManagers[rnd]; selectedMrtMg.StartItIfNotStarted(); SetStep(2); } if (step == 2) { if (selectedMrtMg.IsReady()) { timer = maxTimeOfWaitingForNextExplosion; SetStep(3); } } if (step == 3) { timer = MathfPlus.DecByDeltatimeToZero(timer); if (timer == 0) { SetStep(1); } } }
void FixedUpdate() { if (isEnabled) { if (isEnabledFirstTick) { enabledFixedUpdateCount++; if (enabledFixedUpdateCount == 30) { isEnabledFirstTick = false; } } time_InObjectsGarbageRemove_Counter = MathfPlus.DecByDeltatimeToZero(time_InObjectsGarbageRemove_Counter); if (time_InObjectsGarbageRemove_Counter == 0) { time_InObjectsGarbageRemove_Counter = time_InObjectsGarbageRemove_Max; int i = 0; while (i < objectsIn.Count) { if (objectsIn[i] == null) { objectsIn.RemoveAt(i); continue; } i++; } } } }
void Update() { if (status == ActionStatus.Running) { if (!firstInitIsDone) { delay = MathfPlus.DecByDeltatimeToZero(delay); if (delay == 0) { firstInitIsDone = true; for (int i = 0; i < playerRenderAreas.Length; i++) { playerRenderAreas[i].HideSoldiers(); } indexOfCurRelationAreaThatPlayerIsIn = GetIndexOfAreaThatPlayerIsIn(); if (indexOfCurRelationAreaThatPlayerIsIn >= 0) { playerRenderAreas[indexOfCurRelationAreaThatPlayerIsIn].ShowSoldiers(); } } } else { CheckAndInitIndices(); } } }
// Update is called once per frame void Update() { keyCheckCounter = MathfPlus.DecByDeltatimeToZero(keyCheckCounter); if (keyCheckCounter == 0) { if (waitingForKey) { if (CustomInputManager.IsAnyKeyDown() || shouldLoadImmediately) { StartLoadingLevel(); } } } float scWbbH = ((float)(Screen.width)) / ((float)(Screen.height)); //print(scWbbH); if (scWbbH < scWbbHIn16b9) { float moreX = (scWbbHIn16b9 - scWbbH) * xDiffIn16b9And5b4; storyPageText.transform.position = new Vector3(storyPageTextOriginalX + moreX, storyPageText.transform.position.y, storyPageText.transform.position.z); } }
void Update() { curAudioTimeCounter = MathfPlus.DecByDeltatimeToZero(audioSource.pitch); isPlaying = audioSource.isPlaying; time = audioSource.time; if (shouldDecreaseVolumeToEnd) { SetCustomVolume(customVolume - (Time.deltaTime / decreasingCustomVolumeTime)); if (customVolume == 0) { shouldDecreaseVolumeToEnd = false; } } if (isItADeadAudioInfo) { if (!isGamePaused && !isPlaying) { Destroy(this.gameObject); } } }
void Update() { if (isPlaying) { timeCounter = MathfPlus.DecByDeltatimeToZero(timeCounter); if (timeCounter == 0) { if (nextIndex >= audioClips.Length) { isPlaying = false; } else { timeCounter = audioClipTimes[nextIndex]; if (audioClips[nextIndex] != null) { audioInfo.PlayClip(audioClips[nextIndex]); } nextIndex++; } } } }
void Update() { if (groupDelayCounter > 0) { groupDelayCounter = MathfPlus.DecByDeltatimeToZero(groupDelayCounter); } }
void Update() { timeCounter = MathfPlus.DecByDeltatimeToZero(timeCounter); delayTimeToEnableCollider = MathfPlus.DecByDeltatimeToZero(delayTimeToEnableCollider); if (timeCounter <= time - minTimeBeforeConsideringHit) { if (isHitted) { if (timeCounter <= hitStartingTime - explosionTimeAfterFirstHit) { Explode(); return; } } } if (timeCounter == 0) { Explode(); return; } if (delayTimeToEnableCollider == 0) { delayTimeToEnableCollider = 1000000; Collider col = GetComponent <Collider>(); if (!col.enabled) { col.enabled = true; } } }
//Pre void DoPre_FightInPoint() { //timeToGoToClosePoint_Counter = MathfPlus.DecByDeltatimeToZero(timeToGoToClosePoint_Counter); timeToCheckAvailableTargets_Counter = MathfPlus.DecByDeltatimeToZero(timeToCheckAvailableTargets_Counter); time_ChangePoint_Counter = MathfPlus.DecByDeltatimeToZero(time_ChangePoint_Counter); }
public override void RunIt() { base.RunIt(); if (levelStep < 0) { missionFailCounter = MathfPlus.DecByDeltatimeToZero(missionFailCounter); } #region -1: Mission failed by not supporting allies if (levelStep == step_MissionFail_AlliesNotSupported) { IfItsOkSetMissionFailed(MissionFailType.AlliesNotSupported); } #endregion #region -2: Mission failed by leaving fight area if (levelStep == step_MissionFail_YouLeftFightArea) { IfItsOkSetMissionFailed(MissionFailType.YouLeftFightArea); } #endregion #region -3: Mission failed. You are detected by enemies. if (levelStep == step_MissionFail_YouAreDetectedByEnemies) { IfItsOkSetMissionFailed(MissionFailType.YouAreDetectedByEnemies); } #endregion #region -4: Mission failed. You left area without planting dynamites. if (levelStep == step_MissionFail_YouLeftAreaWithoutPlantingDynamites) { IfItsOkSetMissionFailed(MissionFailType.YouLeftAreaWithoutPlantingDynamites); } #endregion #region -5: Mission failed. Dynamte Has Been Exploded Before Communication Breakdown. if (levelStep == step_MissionFail_DynamteHasBeenExplodedBeforeCommunicationBreakdown) { IfItsOkSetMissionFailed(MissionFailType.DynamteHasBeenExplodedBeforeCommunicationBreakdown); } #endregion #region -6: Mission failed. Enemy Heard Your Fire. if (levelStep == step_MissionFail_EnemyHeardYourFire) { IfItsOkSetMissionFailed(MissionFailType.EnemyHeardYourFire); } #endregion #region -7: Mission failed. Enemy Saw His Mate Nash. if (levelStep == step_MissionFail_EnemySawHisMateNash) { IfItsOkSetMissionFailed(MissionFailType.EnemySawHisMateNash); } #endregion }
// Update is called once per frame void Update() { ctr = MathfPlus.DecByDeltatimeToZero(ctr); if (ctr == 0) { Instantiate(objToCreate, transform.position, transform.rotation); ctr = maxTime; } }
void SlowlyTrySetAChildFightRegGrenade() { childGrenadeCheckTimeCounter = MathfPlus.DecByDeltatimeToZero(childGrenadeCheckTimeCounter); if (childGrenadeCheckTimeCounter == 0) { childGrenadeCheckTimeCounter = childGrenadeCheckMaxTime; TrySetAChildFightRegGrenade(); } }
// Update is called once per frame void Update() { timeCounter = MathfPlus.DecByDeltatimeToZero(timeCounter); if (timeCounter == 0) { timeCounter = 100000000; EnableZakhmiAllyPack(); } }
void Update() { time_RefreshingTargettingEnemies_Counter = MathfPlus.DecByDeltatimeToZero(time_RefreshingTargettingEnemies_Counter); if (time_RefreshingTargettingEnemies_Counter == 0) { time_RefreshingTargettingEnemies_Counter = time_RefreshingTargettingEnemies_Max; RefreshTargettingEnemiesStats(); } }
void Update() { if (isEnabled) { timeCounter = MathfPlus.DecByDeltatimeToZero(timeCounter); if (timeCounter == 0) { EndIt(); return; } checkPlayerInTimeCounter = MathfPlus.DecByDeltatimeToZero(checkPlayerInTimeCounter); if (checkPlayerInTimeCounter == 0) { IsPlayerIn = false; } if (IsPlayerIn) { countPlayerStayTime = true; } else { countPlayerStayTime = false; playerStayingTime = 0; } if (countPlayerStayTime) { playerStayingTime += Time.deltaTime; if (playerStayingTime > delayTimeToKillPlayer) { if (IsPlayerIn) { bool isOK = false; if (GetNumOfInsideEnemies() > skippabaleNumOfInsideAliveSolds) { isOK = true; } if (isOK) { KillPlayer(); EndIt(); } } } } } }
// Update is called once per frame void Update() { if (delayCounter > 0) { delayCounter = MathfPlus.DecByDeltatimeToZero(delayCounter); if (delayCounter == 0) { animation[animation.clip.name].time = time; } } }
void Update() { if (khalooGunParticleCounter > 0) { khalooGunParticleCounter = MathfPlus.DecByDeltatimeToZero(khalooGunParticleCounter); if (khalooGunParticleCounter == 0) { khalooGunFireParticle.GetComponent <ParticleSystem>().Stop(); khalooGunFireParticle.SetActiveRecursively(false); } } }
// void Update() { #region Show For A While if (showForAWhile_Step == ShowForAWhileStep.FirstAlpha) { StartIncreasingAlpha(showForAWhile_StartingAlphaSpeed); showForAWhile_Step = ShowForAWhileStep.Showing; } if (showForAWhile_Step == ShowForAWhileStep.Showing) { showForAWhile_DurationCounter = MathfPlus.DecByDeltatimeToZero(showForAWhile_DurationCounter); if (showForAWhile_DurationCounter == 0) { StartDecreasingAlpha(showForAWhile_EndAlphaSpeed); showForAWhile_Step = ShowForAWhileStep.EndAlpha; } } if (showForAWhile_Step == ShowForAWhileStep.EndAlpha) { if (alpha == 0) { showForAWhile_Step = ShowForAWhileStep.Idle; } } #endregion #region Alpha if (alphaStatus == HUDAlphaStat.Increasing) { SetAlpha(alpha + alphaChangeSpeed * Time.deltaTime); if (alphaStatus == HUDAlphaStat.Mid) { alphaStatus = HUDAlphaStat.Increasing; } } if (alphaStatus == HUDAlphaStat.Decreasing) { SetAlpha(alpha - alphaChangeSpeed * Time.deltaTime); if (alphaStatus == HUDAlphaStat.Mid) { alphaStatus = HUDAlphaStat.Decreasing; } } #endregion }
// void Update() { #region PassingDelay if (IsStatus(MusicPlayingStatus.PassingDelay)) { newSongStartDelay = MathfPlus.DecByDeltatimeToZero(newSongStartDelay); if (newSongStartDelay == 0) { MapLogic.Instance.audioInfo_Music.SetCustomVolume(1); MapLogic.Instance.audioInfo_Music.PlayClip(GetAudioClipBySongType(curPlayingSong)); SetStatus(MusicPlayingStatus.Playing); } } #endregion #region FadingToNewMusic if (IsStatus(MusicPlayingStatus.FadingToNewMusic)) { MapLogic.Instance.audioInfo_Music.SetCustomVolume(MapLogic.Instance.audioInfo_Music.customVolume - Time.deltaTime * curFadeSpeed); if (MapLogic.Instance.audioInfo_Music.customVolume == 0) { curPlayingSong = queuedSong; queuedSong = MusicSong.None; SetStatus(MusicPlayingStatus.PassingDelay); } } #endregion #region FadingToNone if (IsStatus(MusicPlayingStatus.FadingToNone)) { MapLogic.Instance.audioInfo_Music.SetCustomVolume(MapLogic.Instance.audioInfo_Music.customVolume - Time.deltaTime * curFadeSpeed); if (MapLogic.Instance.audioInfo_Music.customVolume == 0) { curPlayingSong = MusicSong.None; MapLogic.Instance.audioInfo_Music.Stop(); SetStatus(MusicPlayingStatus.Idle); } } #endregion }
public override void RunIt() { base.RunIt(); if (step == 1) { if (needsToBeFinished) { if (!soldInfo.IsVoiceOnBusyTimer()) { SetFinished(false); return; } } if (startDelayTime > 0) { startDelayTime = MathfPlus.DecByDeltatimeToZero(startDelayTime); } if (startDelayTime == 0) { if (!soldInfo.IsVoiceOnBusyTimer()) { soldInfo.PlayVoiceWithAdditionalBusyTime(audioClips, time_Delay_Min, time_Delay_Max); if (setDoneAfterOneTalk) { timeCounter = soldInfo.voiceBusyTimeCounter; step = 2; } return; } } } if (step == 2) { timeCounter = MathfPlus.DecByDeltatimeToZero(timeCounter); if (timeCounter == 0) { SetFinished(true); return; } } }
// Update is called once per frame void Update() { if (status == ActionStatus.NotStarted) { delayToStart = MathfPlus.DecByDeltatimeToZero(delayToStart); if (delayToStart == 0) { status = ActionStatus.Running; } } if (status == ActionStatus.Running) { if (logTrig.IsPlayerIn()) { if (!myRainsAreActive) { myRainsAreActive = true; playerCharNew.campRain.emit = false; foreach (ParticleEmitter pe in rains) { pe.emit = true; } } } else { if (myRainsAreActive) { myRainsAreActive = false; playerCharNew.campRain.emit = true; foreach (ParticleEmitter pe in rains) { pe.emit = false; } } } } }
void Update() { if (started) { timer = MathfPlus.DecByDeltatimeToZero(timer); if (timer == 0) { if (counter < particles.Length) { particles[counter].SetActiveRecursively(true); counter++; SetTimer(); } } } }
public override void UpdateMe() { base.UpdateMe(); if (step == 1) { cam01.active = true; SetStep(1.1f); } if (step == 1.1f) { ctr = MathfPlus.DecByDeltatimeToZero(ctr); if (ctr == 0) { StartEnding(false); } } }
bool SlowlyCheckPlayerCritStateWhileMoving() { time_CheckPlayerCritStateWhileMoving_Counter = MathfPlus.DecByDeltatimeToZero(time_CheckPlayerCritStateWhileMoving_Counter); if (time_CheckPlayerCritStateWhileMoving_Counter == 0) { time_CheckPlayerCritStateWhileMoving_Counter = time_CheckPlayerCritStateWhileMoving_Max; if (IsPlayerStillInCriticSitu()) { if ((movementAct.remainingPathLength / movementAct.vMid) > minMoveTimeForPlayerCriticalFight) { if (soldInfo.IsPlayerInView() && soldInfo.ArePlayerSidesInView()) { return(true); } } } } return(false); }
void Update() { if (isStarted) { if (shouldStop && !audio.isPlaying) { StopIt(); } if (!audio.isPlaying) { timer = MathfPlus.DecByDeltatimeToZero(timer); } if (timer == 0) { audio.PlayClip(soundClips); timer = Random.RandomRange(minTimeDelay, maxTimeDelay); } } }
// Update is called once per frame void Update() { if (transform.position.y < maxY) { transform.Translate(new Vector3(0, moveUpSpeed * Time.deltaTime, 0)); } else { transform.position = new Vector3(transform.position.x, maxY, transform.position.z); } timeToEndCredits = MathfPlus.DecByDeltatimeToZero(timeToEndCredits); delayTimeToCheckEscapeKey = MathfPlus.DecByDeltatimeToZero(delayTimeToCheckEscapeKey); if (timeToEndCredits == 0) { GameController.LoadMainMenu(); } if (!isEndingSceneByEscapeKey) { if (delayTimeToCheckEscapeKey == 0 && CustomInputManager.KeyDown_Escape()) //GameController.GetKeyDown(KeyCode.Escape)) { isEndingSceneByEscapeKey = true; } } if (isEndingSceneByEscapeKey) { musicAudioInfo.SetCustomVolume(musicAudioInfo.customVolume - Time.deltaTime * audioFadeSpeed); if (musicAudioInfo.customVolume == 0) { GameController.LoadMainMenu(); } } }
void Update() { if (step == 1) { if (delayTime > 0) { delayTime = MathfPlus.DecByDeltatimeToZero(delayTime); if (delayTime == 0) { SetStep(2); } } else { SetStep(2); } } if (step == 2) { PlayExplosionEffects(); GetComponent <Explosion>().Explode(); SetReady(false); SetStep(3); } if (step == 3) { if (!curPar.isPlaying) { Done(); } } }
void OnTriggerStay(Collider _col) { Collider col = _col; if (col == null) { return; } string colTag = col.transform.root.tag.ToLower(); if (colTag == GeneralStats.playerTagName_ToLower) { timer = MathfPlus.DecByDeltatimeToZero(timer); if (timer == 0) { DoDamage(); timer = timeToApplyDamage; } } }
// Update is called once per frame void Update() { if (!isFinished) { if (isStarted) { initialDelayTimeCounter = MathfPlus.DecByDeltatimeToZero(initialDelayTimeCounter); if (initialDelayTimeCounter == 0) { if (currentSoldier == null) { if (createSoldierDelayTimeCounter > 0) { createSoldierDelayTimeCounter -= Time.deltaTime; if (createSoldierDelayTimeCounter < 0) { createSoldierDelayTimeCounter = 0; } } } if (RespawnPointType == RespawnPointTypeEnum.Time) { timeCounter -= Time.deltaTime; if (timeCounter <= 0) { timeCounter = 0; SetFinished(); } } } } } }