Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
Dieses Repo ist archiviert. Du kannst Dateien sehen und es klonen, kannst aber nicht pushen oder Issues/Pull-Requests öffnen.

48 Zeilen
853B

  1. using UnityEngine;
  2. using System.Collections;
  3. public class Actor : MonoBehaviour
  4. {
  5. protected Action action;
  6. private bool paused = false;
  7. protected void Update()
  8. {
  9. if (paused || action == null)
  10. return;
  11. if (action.isRunning())
  12. action.step(Time.deltaTime);
  13. }
  14. public void AttachAction(Action tgtAction)
  15. {
  16. action = tgtAction;
  17. action.setActor(this);
  18. action.start();
  19. }
  20. public void StopAction()
  21. {
  22. action.stop();
  23. action = null;
  24. }
  25. public void PauseAction()
  26. {
  27. paused = true;
  28. }
  29. public void UnpauseAction()
  30. {
  31. paused = false;
  32. }
  33. public void SetTimeScale(float ts)
  34. {
  35. if (action is ActionInterval)
  36. {
  37. ((ActionInterval)action).setTimeScale(ts);
  38. }
  39. }
  40. }