Du kan inte välja fler än 25 ämnen
Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
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);
- }
- }
- }
|