void FixedUpdate() { if (OnFixedUpdate != null) { OnFixedUpdate.Invoke(); } }
public void FixedUpdate() { OnFixedUpdate?.Invoke(); foreach (Entity entity in _entities.ToList()) { entity.FixedUpdate(); } foreach (Entity entity in _entities.ToList()) { entity.GetCommands(); } foreach (Entity entity in _entities.ToList()) { entity.ExecuteCommands(); } foreach (Entity entity in _entities.ToList()) { entity.UpdatePhysics(); } UpdatePhysics?.Invoke(); }
protected virtual void FixedUpdate() { if (GameManager.playing) { OnFixedUpdate?.Invoke(); } }
private void FixedUpdate() { if (OnFixedUpdate != null) { OnFixedUpdate.Invoke(Time.deltaTime); } }
/// <summary> /// Adds the current deltaTime to update ticks and processes simulated fixed update. /// </summary> private void UpdateTicks(float deltaTime) { updateTicks += deltaTime; while (updateTicks >= adjustedFixedUpdate) { updateTicks -= adjustedFixedUpdate; //If at maximum value then reset fixed frame. //This would probably break the game but even at 128t/s //it would take over a year of the server running straight to ever reach this value! if (FixedFrame == uint.MaxValue) { FixedFrame = 0; } FixedFrame++; OnPreFixedUpdate?.Invoke(); OnFixedUpdate?.Invoke(); Physics2D.Simulate(Time.fixedDeltaTime); Physics.Simulate(Time.fixedDeltaTime); OnPostFixedUpdate?.Invoke(); } //Recover timing towards default fixedDeltaTime. adjustedFixedUpdate = Mathf.MoveTowards(adjustedFixedUpdate, Time.fixedDeltaTime, TIMING_RECOVER_RATE * deltaTime); }
/// <summary> /// fixed update cycle called by the state /// stores velocity of body into Velocity at start /// and sets body velocity at end to current Velocity /// </summary> public void FixedUpdate() { Velocity = body.velocity; OnFixedUpdate?.Invoke(); body.velocity = Velocity; }
public void Tick() { while ((lastUpdate + _updateFrequency) < Time) { OnFixedUpdate.Invoke(); lastUpdate += _updateFrequency; } }
private void FixedUpdate() { m_FixedTime += Time.deltaTime; if (m_FixedTime >= 1) { m_FixedTime--; OnTick?.Invoke(); } OnFixedUpdate?.Invoke(); }
public void FixedUpdate() { if (_invincibilityTimer == 0) { IsInvincible = false; } else { _invincibilityTimer--; } OnFixedUpdate?.Invoke(this); }
public RuntimeService() { _runtimeGameObject = new GameObject("RuntimeClients"); Object.DontDestroyOnLoad(_runtimeGameObject); _runtimeClient = RegisterClient <RuntimeClient>(); _runtimeClient.OnUpdate += () => OnUpdate?.Invoke(); _runtimeClient.OnFixedUpdate += () => OnFixedUpdate?.Invoke(); _runtimeClient.OnLateUpdate += () => OnLateUpdate?.Invoke(); _runtimeClient.OnQuit += () => OnQuit?.Invoke(); _runtimeClient.OnPause += pause => OnPause?.Invoke(pause); }
private void ManualFixedUpdate() { switch (Type) { case PlayerObjectType.ThisPlayer: Tick++; UserInput = new Vector3(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"), 0); _inputHistory[Tick] = UserInput; OnFixedUpdate?.Invoke(UserInput, Tick); _oldPosition = _position; _position += UserInput * Consts.ClientSpeed * Time.fixedDeltaTime; transform.position = _position; break; } }
internal void FixedUpdateInternal() { if (PhysicsEnabled) { float deg = MathHelper.ToDegrees(PhysicsBody.Rotation); Vector2 pos = (PhysicsBody.Position - (PhysicsShapeOffset * Physics.UPP)) / Physics.UPP; Position = pos; Rotation = deg; if (VelocityDampingX != 0 || VelocityDampingY != 0) { float velocityDampLerpX = MathHelper.Lerp(PhysicsBody.LinearVelocity.X, 0.0f, VelocityDampingX); float velocityDampLerpY = MathHelper.Lerp(PhysicsBody.LinearVelocity.Y, 0.0f, VelocityDampingY); PhysicsBody.LinearVelocity = new Vector2(velocityDampLerpX, velocityDampLerpY); } } FixedUpdate(); OnFixedUpdate.Invoke(); }
public virtual void FixedUpdateCallback() { OnFixedUpdate?.Invoke(); }
private void FixedUpdate() { OnFixedUpdate?.Invoke(); }
protected virtual void FixedUpdate() { OnFixedUpdate?.Invoke(); }
protected virtual void FixedUpdate() { OnFixedUpdate?.Invoke(Time.fixedDeltaTime); }
protected override void StateFixedUpdate() { base.StateFixedUpdate(); OnFixedUpdate?.Invoke(this); }
void FixedUpdate() { OnFixedUpdate?.Invoke(Time.fixedDeltaTime); }
void FixedUpdate() => OnFixedUpdate?.Invoke();
public void InvokeOnFixedUpdate(float fDelta) { OnFixedUpdate?.Invoke(this, fDelta); }