EndScene.ts 904 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. const {ccclass, property} = cc._decorator;
  2. @ccclass
  3. export default class NewClass extends cc.Component {
  4. //需要更多源码联系Q:852183691
  5. //或者
  6. //关注微信公众号“史于二”
  7. @property(cc.Prefab)
  8. RankInfo:cc.Prefab = null;
  9. @property(cc.Node)
  10. rannode:cc.Node = null;
  11. // LIFE-CYCLE CALLBACKS:
  12. Ani = null;
  13. Anistate = null;
  14. rInfo = null;
  15. onLoad () {
  16. this.rInfo = cc.instantiate(this.RankInfo);
  17. this.rannode.addChild(this.rInfo);
  18. }
  19. start () {
  20. this.PlayAni();
  21. }
  22. update (dt) {
  23. // cc.systemEvent.on(cc.SystemEvent.EventType.KEY_DOWN,this.onKeyDown,this);
  24. }
  25. /**
  26. * 排行榜的动画播放
  27. */
  28. PlayAni(){
  29. this.Ani = this.rInfo.getComponent(cc.Animation);
  30. this.scheduleOnce(function(){
  31. this.Anistate = this.Ani.play();
  32. })
  33. }
  34. }