TestJump.ts 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import { _decorator, Component, Node, Vec3, Camera, v3 } from 'cc';
  2. const { ccclass, property } = _decorator;
  3. @ccclass('TestJump')
  4. export class TestJump extends Component {
  5. // @property({type: Node})
  6. // public testCube: Node;
  7. // @property({type: Camera})
  8. // public testCamera: Camera;
  9. @property({type: Node})
  10. public testNode: Node;
  11. start () {
  12. this.onButtonClicked()
  13. // [3]
  14. }
  15. // update (deltaTime: number) {
  16. // // [4]
  17. // }
  18. public onButtonClicked() {
  19. // this.testCube.position = Vec3.ZERO;
  20. // this.testCube.qtPosition(new Vec3(0, 1, 1), 1)
  21. // this.testCube.qtJumpPosition(new Vec3(3, 0, 0), 3, 1, 1)
  22. // .then(this.testCube.qtJumpPosition(new Vec3(0, 0, 0), 3, 1, 1)).union().repeat(5).start();
  23. // this.testCube.qtJumpPosition(new Vec3(3, 1, 0), 3, 2, 2, {
  24. // onComplete: ()=> {
  25. // console.log('end');
  26. // }
  27. // }).start();
  28. // this.testCube.qtPunchScale(new Vec3(1, 1, 1), 1, {
  29. // onStart: ()=> {
  30. // console.log('begin');
  31. // },
  32. // onComplete: ()=> {
  33. // console.log('end');
  34. // }
  35. // }).start();
  36. // this.testCube.qtShakePosition(1, 1).start();
  37. // this.testCamera.qtShakePosition(new Vec3(0.1, 0.1, 0), 1, {
  38. // onStart: ()=> {
  39. // console.log('begin');
  40. // },
  41. // onComplete: ()=> {
  42. // console.log('end');
  43. // }
  44. // }).start();
  45. this.testNode.qtJumpPosition(v3(300, 0, 0), 100, 1, 1, {
  46. onStart: ()=> {
  47. console.log('begin');
  48. },
  49. onComplete: ()=> {
  50. console.log('end');
  51. }
  52. }).start()
  53. // this.testCube.qtShakeRotation(1, 90).start();
  54. // this.testCube.qtShakeScale(1, 1).start();
  55. }
  56. }