babylon.action.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. var BABYLON;
  2. (function (BABYLON) {
  3. var Action = (function () {
  4. function Action(trigger, condition) {
  5. this.trigger = trigger;
  6. this._nextActiveAction = this;
  7. this._condition = condition;
  8. }
  9. // Methods
  10. Action.prototype._prepare = function () {
  11. };
  12. Action.prototype._executeCurrent = function () {
  13. if (this._condition) {
  14. if (!this._condition.isValid()) {
  15. return;
  16. }
  17. }
  18. this._nextActiveAction.execute();
  19. if (this._nextActiveAction._child) {
  20. this._nextActiveAction = this._nextActiveAction._child;
  21. } else {
  22. this._nextActiveAction = this;
  23. }
  24. };
  25. Action.prototype.execute = function () {
  26. };
  27. Action.prototype.then = function (action) {
  28. this._child = action;
  29. action._actionManager = this._actionManager;
  30. action._prepare();
  31. return action;
  32. };
  33. Action.prototype._getTarget = function (targetType, targetName) {
  34. return this._actionManager._getTarget(targetType, targetName);
  35. };
  36. Action.prototype._getProperty = function (propertyPath) {
  37. return this._actionManager._getProperty(propertyPath);
  38. };
  39. Action.prototype._getEffectiveTarget = function (target, propertyPath) {
  40. return this._actionManager._getEffectiveTarget(target, propertyPath);
  41. };
  42. return Action;
  43. })();
  44. BABYLON.Action = Action;
  45. })(BABYLON || (BABYLON = {}));
  46. //# sourceMappingURL=babylon.action.js.map