private void ImplementUpdate(DwarfTime gameTime, ChunkManager chunks) { UpdateTimer.Update(gameTime); if (UpdateTimer.HasTriggered) { GameComponent p = (GameComponent)Parent; var voxelBelow = new VoxelHandle(chunks, GlobalVoxelCoordinate.FromVector3(p.GlobalTransform.Translation + Vector3.Down * 0.25f)); if (voxelBelow.IsValid) { var shadowTarget = VoxelHelpers.FindFirstVoxelBelow(voxelBelow); if (shadowTarget.IsValid) { var h = shadowTarget.Coordinate.Y + 1; Vector3 pos = p.GlobalTransform.Translation; pos.Y = h; float scaleFactor = GlobalScale / (Math.Max((p.GlobalTransform.Translation.Y - h) * 0.25f, 1)); Matrix newTrans = OriginalTransform; newTrans *= Matrix.CreateScale(scaleFactor); newTrans.Translation = (pos - p.GlobalTransform.Translation) + new Vector3(0.0f, 0.1f, 0.0f); LightRamp = new Color(LightRamp.R, LightRamp.G, LightRamp.B, (int)(scaleFactor * 255)); Matrix globalRotation = p.GlobalTransform; globalRotation.Translation = Vector3.Zero; LocalTransform = newTrans * Matrix.Invert(globalRotation); } } UpdateTimer.HasTriggered = false; } }
private void Follow(double lastTick) { followTimer.Update(lastTick); if (!followTimer.HasElapsed) { return; } Player owner = GetVisible <Player>(OwnerGuid); if (owner == null) { // this shouldn't happen, log it anyway log.Error($"VanityPet {Guid} has lost it's owner {OwnerGuid}!"); RemoveFromMap(); return; } // only recalculate the path to owner if distance is significant float distance = owner.Position.GetDistance(Position); if (distance < FollowMinRecalculateDistance) { return; } MovementManager.Follow(owner, FollowDistance); followTimer.Reset(); }
public override void Update() { base.Update(); upgradeTimer.Update(); managerTimer.Update(); investorTimer.Update(); }
public void Update(double lastTick) { mailTimer.Update(lastTick); if (mailTimer.HasElapsed) { bool sendAvailableMail = false; foreach (MailItem mail in pendingMail) { if (!mail.IsReadyToDeliver()) { continue; } availableMail.Add(mail.Id, mail); sendAvailableMail = true; } // prevent sending multiple mail packets if (sendAvailableMail) { SendAvailableMail(); } // TODO: remove expired mail mailTimer.Reset(); } }
private void Update() { if (mEnabled) { mCycleTimer.Update(); this.transform.localEulerAngles = Vector3.Lerp(mStartAngle, this.TargetAngle, mCycleTimer.TimeElapsedNormalized); if (mCycleTimer.TimeReached) { if (mCurrentLoop > 0) { // Still some loops left mCurrentLoop--; mCycleTimer.Start(this.CycleLengthSeconds); this.transform.localEulerAngles = mStartAngle; } else if (mCurrentLoop == 0) { mEnabled = false; } else { // Otherwise, less-than-zero is infinite loop; just reset the angle this.transform.localEulerAngles = mStartAngle; mCycleTimer.Start(this.CycleLengthSeconds); } } } }
public override void Update(DwarfTime gameTime, ChunkManager chunks, Camera camera) { UpdateTimer.Update(gameTime); if (HasMoved && UpdateTimer.HasTriggered) { Body p = (Body)Parent; VoxelChunk chunk = chunks.ChunkData.GetVoxelChunkAtWorldLocation(p.GlobalTransform.Translation); if (chunk != null) { Vector3 g = chunk.WorldToGrid(p.GlobalTransform.Translation + Vector3.Down * 0.25f); int h = chunk.GetFilledVoxelGridHeightAt((int)g.X, (int)g.Y, (int)g.Z); if (h != -1) { Vector3 pos = p.GlobalTransform.Translation; pos.Y = h; pos += VertexNoise.GetNoiseVectorFromRepeatingTexture(pos + Vector3.Down * 0.25f); float scaleFactor = GlobalScale / (Math.Max((p.GlobalTransform.Translation.Y - h) * 0.25f, 1)); Matrix newTrans = OriginalTransform; newTrans *= Matrix.CreateScale(scaleFactor); newTrans.Translation = (pos - p.GlobalTransform.Translation) + new Vector3(0.0f, 0.1f, 0.0f); Tint = new Color(Tint.R, Tint.G, Tint.B, (int)(scaleFactor * 255)); LocalTransform = newTrans; } } UpdateTimer.HasTriggered = false; } base.Update(gameTime, chunks, camera); }
public override void Update() { base.Update(); updateTimer.Update(); adTimer.Update(); buyButtonStateTimer.Update(); }
public override void Update() { base.Update(); updateProfitTimer.Update(); updateBuyManagerTimer.Update(); updateBuyGeneratorCountControls.Update(); automaticParticlesUpdater.Update(); }
private void Update() { if (!mStillAlive) { mTimer.Update(); DoDying(); } }
public override void Update() { base.Update(); if (data != null) { wishButtonTimer.Update(); } }
public override void Update() { base.Update(); buyButtonTimer.Update(); adTimer.Update(); missedTimer.Update(); }
public override void Update() { base.Update(); upgradeAlertTimer.Update(); managerAlertTimer.Update(); investorAlertTimer.Update(); visibilityTimer.Update(); UpdateIcons(); }
public override void Update() { base.Update(); updateTimer.Update(); if (boostService != null && boostService.IsBoostRunning) { progressFill.fillAmount = boostService.TempBoostProgress; } }
void Update() { if (_zoomTimer != null) { _zoomTimer.Update(); if (_zoomTimer.HasEnded) { _zoomTimer = null; } } }
private void UpdateChanneling(float deltaTime) { if (State == SpellStateEnum.STATE_CHANNELING) { ChannelTimer.Update(deltaTime); if (ChannelTimer.Finished()) { OnChannelOver(); } } }
private void Update() { if (mStartedEmitting) { mDurationTimer.Update(); mFireTimer.Update(); if (mDurationTimer.TimeReached && this.Duration != -1f) { Stop(); } } }
private void UpdateCooldown(float deltaTime) { if (State == SpellStateEnum.STATE_COOLDOWN) { CooldownTimer.Update(deltaTime); if (CooldownTimer.Finished()) { CooldownTimer = null; State = SpellStateEnum.STATE_READY; } } }
private void Update() { mTimer.Update(); if (mStillAlive) { DoTTL(); } else { DoDying(); } }
public override void Update() { base.Update(); /* * if(Input.GetKeyUp(KeyCode.Space)) { * if(State == HeaderState.Expanded) { * Collapse(); * } else { * Expand(); * } * } * * Debug.Log($"game scroll view position => {gameScroll.VerticalNormalizedPosition}".Colored(ConsoleTextColor.orange).Bold());*/ updateTimer.Update(); }
public override void Update(DwarfTime time) { UpdateTimer.Update(time); if (UpdateTimer.HasTriggered) { List <ResourceAmount> currentResources = Faction.ListResources().Values.ToList(); bool isDifferent = CurrentResources.Count != currentResources.Count || currentResources.Where((t, i) => t.NumResources != CurrentResources[i].NumResources).Any(); if (isDifferent) { CurrentResources.Clear(); CurrentResources.AddRange(currentResources); CreateResourcePanels(); } } base.Update(time); }
private void Update() { if (mTimer.Enabled) { mTimer.Update(); float lerpTime = mTimer.TimeElapsedNormalized; if (!mReverseMotion) { mRenderer.color = Color.Lerp(this.InitialColor, this.TargetColor, lerpTime); this.transform.localScale = Vector3.Lerp(this.InitialScale, this.TargetScale, lerpTime); } else { mRenderer.color = Color.Lerp(this.TargetColor, this.InitialColor, lerpTime); this.transform.localScale = Vector3.Lerp(this.TargetScale, this.InitialScale, lerpTime); } if (mTimer.TimeReached) { mTimer.Stop(); } } else { if (this.Loops == -1 || mCurrentLoopIteration < this.Loops) { mCurrentLoopIteration++; if (this.ReverseOnLoop) { mReverseMotion = !mReverseMotion; } mTimer.Start(this.DurationSeconds); } else { Destroy(this); } } }
public void Update() { mFTimer.Update(); // If we've detected that we have not moved much relative to the last anchor point, // start a timer. If the timer finishes then we will assume the host hasn't moved much // in the last X seconds. If we detect a movement, stop and reset the timer. // ALTERNATE: If host is on a moving platform, we can start counting as well but that flag // must be set externally by the platform itself. if (!mBodyHasMoved || this.IsOnMovingPlatform) { if (!mTimer.Enabled) { mTimer.Start(this.TimeToSettle); } else { mTimer.Update(); if (mTimer.TimeReached) { this.OnFinishedCallback?.Invoke(); if (this.ActivateOnSettle != null && ((this.CogTriggersOnceOnly && !mCogTriggered) || (!this.CogTriggersOnceOnly))) { this.ActivateOnSettle.Activate(this, null); mCogTriggered = true; } } } } else if (mTimer.Enabled) { mTimer.Stop(); } // Record the last position mLastPosition = this.transform.position; }
public override void Update(DwarfTime gameTime, ChunkManager chunks, Camera camera) { UpdateTimer.Update(gameTime); if (UpdateTimer.HasTriggered) { Body p = (Body)Parent; var voxelBelow = new VoxelHandle(chunks.ChunkData, GlobalVoxelCoordinate.FromVector3(p.GlobalTransform.Translation + Vector3.Down * 0.25f)); if (voxelBelow.IsValid) { var shadowTarget = VoxelHelpers.FindFirstVoxelBelow(voxelBelow); if (shadowTarget.IsValid) { var h = shadowTarget.Coordinate.Y + 1; Vector3 pos = p.GlobalTransform.Translation; pos.Y = h; float scaleFactor = GlobalScale / (Math.Max((p.GlobalTransform.Translation.Y - h) * 0.25f, 1)); Matrix newTrans = OriginalTransform; newTrans *= Matrix.CreateScale(scaleFactor); newTrans.Translation = (pos - p.GlobalTransform.Translation) + new Vector3(0.0f, 0.1f, 0.0f); Tint = new Color(Tint.R, Tint.G, Tint.B, (int)(scaleFactor * 255)); Matrix globalRotation = p.GlobalTransform; globalRotation.Translation = Vector3.Zero; LocalTransform = newTrans * Matrix.Invert(globalRotation); } } UpdateTimer.HasTriggered = false; } base.Update(gameTime, chunks, camera); }
public override void Update() { base.Update(); updateControlsTimer.Update(); }
public override void Update() { base.Update(); updateTimer.Update(); }
public override void Update() { updateTimer.Update(); }
public override void Update() { base.Update(); wishlistUpdateTimer.Update(); }
public override void Update() { base.Update(); Client?.Service(); reconnectTimer.Update(); }
public override void Update() { base.Update(); inputUpdater.Update(); }