public override void Tick(ServoPartComponent part, float deltaTime) { base.Tick(part, deltaTime); part.localEulerAnglesY += velocity * deltaTime; if (velocity.NearlyZero()) { End(); } }
public override void Tick(ServoPartComponent part, float deltaTime) { base.Tick(part, deltaTime); if (duration > 0.0f || !Misc.Nearly(endAngle, startAngle, 0.0001f)) { accumulationTime = Mathf.Clamp(accumulationTime + deltaTime, 0.0f, duration); part.localEulerAnglesY = startAngle + (endAngle - startAngle) * (accumulationTime / duration); } else { part.localEulerAnglesY = endAngle; } if (accumulationTime >= duration || duration <= 0.0f) { End(); } }
public virtual void Tick(ServoPartComponent servo, float deltaTime) { }