Spinner.cs 375 B

123456789101112131415161718
  1. using System;
  2. using AtomicEngine;
  3. public class Spinner : CSComponent
  4. {
  5. //inspector fields to make speed variable visible in editor
  6. [Inspector]
  7. float speed = 1.0f;
  8. //update function is called each frame
  9. //timeStep: time since last call to update in seconds
  10. void Update(float timeStep)
  11. {
  12. Node.Roll(speed * timeStep * 75.0f);
  13. }
  14. }