You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
|
- using UnityEngine;
- using System.Collections;
-
- public class Actor : MonoBehaviour
- {
- protected Action action;
- private bool paused = false;
-
- protected void Update()
- {
- if (paused || action == null)
- return;
- if (action.isRunning())
- action.step(Time.deltaTime);
- }
-
- public void AttachAction(Action tgtAction)
- {
- action = tgtAction;
- action.setActor(this);
- action.start();
- }
-
- public void StopAction()
- {
- action.stop();
- action = null;
- }
-
- public void PauseAction()
- {
- paused = true;
- }
-
- public void UnpauseAction()
- {
- paused = false;
- }
-
- public void SetTimeScale(float ts)
- {
- if (action is ActionInterval)
- {
- ((ActionInterval)action).setTimeScale(ts);
- }
- }
- }
|