示例#1
0
文件: Actor.java 项目: newisso/libgdx
 /**
  * Updates the actor based on time. Typically this is called each frame by {@link
  * Stage#act(float)}.
  *
  * <p>The default implementation calls {@link Action#act(float)} on each action and removes
  * actions that are complete.
  *
  * @param delta Time in seconds since the last frame.
  */
 public void act(float delta) {
   for (int i = 0, n = actions.size; i < n; i++) {
     Action action = actions.get(i);
     if (action.act(delta)) {
       actions.removeIndex(i);
       action.setActor(null);
       i--;
       n--;
     }
   }
 }
示例#2
0
文件: Actor.java 项目: newisso/libgdx
 public void removeAction(Action action) {
   if (actions.removeValue(action, true)) action.setActor(null);
 }
示例#3
0
文件: Actor.java 项目: newisso/libgdx
 public void addAction(Action action) {
   action.setActor(this);
   actions.add(action);
 }