Exemple #1
0
 public override void Tick(ServoPartComponent part, float deltaTime)
 {
     base.Tick(part, deltaTime);
     part.localEulerAnglesY += velocity * deltaTime;
     if (velocity.NearlyZero())
     {
         End();
     }
 }
Exemple #2
0
 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();
     }
 }
Exemple #3
0
 public virtual void Tick(ServoPartComponent servo, float deltaTime)
 {
 }