Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
Ce dépôt est archivé. Vous pouvez voir les fichiers et le cloner, mais vous ne pouvez pas pousser ni ouvrir de ticket/demande d'ajout.

48 lignes
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. }