AniOpenPanel.ts 653 B

1234567891011121314151617181920
  1. // Learn TypeScript:
  2. // - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
  3. // Learn Attribute:
  4. // - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
  5. // Learn life-cycle callbacks:
  6. // - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
  7. const { ccclass, property } = cc._decorator;
  8. @ccclass
  9. export default class AniOpenPanel extends cc.Component {
  10. onEnable() {
  11. this.node.scale = 0;
  12. //1
  13. cc.tween(this.node).to(0.3,{scale:1},{easing:"backOut"}).start();
  14. //2
  15. //this.node.runAction(cc.scaleTo(0.3, 1).easing(cc.easeBackOut()));
  16. }
  17. }