Roboman.js 1.0 KB

1234567891011121314151617181920212223242526272829
  1. /// <reference path="../TypeScript/Atomic.d.ts"/>
  2. /// <reference path="../TypeScript/AtomicWork.d.ts" />
  3. "atomic component";
  4. var __extends = (this && this.__extends) || function (d, b) {
  5. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  6. function __() { this.constructor = d; }
  7. __.prototype = b.prototype;
  8. d.prototype = new __();
  9. };
  10. var Roboman = (function (_super) {
  11. __extends(Roboman, _super);
  12. function Roboman() {
  13. _super.apply(this, arguments);
  14. }
  15. Roboman.prototype.start = function () {
  16. var node = this.node;
  17. this.animCtrl = node.getComponent("AnimationController");
  18. this.controller = node.getJSComponent("AvatarController");
  19. this.animCtrl.playExclusive("Idle", 0, true, 0.0);
  20. };
  21. Roboman.prototype.update = function (timeStep) {
  22. if (this.controller.idle)
  23. this.animCtrl.playExclusive("Idle", 0, true, 0.1);
  24. else
  25. this.animCtrl.playExclusive("Run", 0, true, 0.1);
  26. };
  27. return Roboman;
  28. })(Atomic.JSComponent);
  29. module.exports = Roboman;