ActionSice.js 748 B

1234567891011121314151617181920212223242526272829303132333435
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. },
  5. ctor: function(){
  6. },
  7. SetAction:function(wCount){
  8. this.node.active = true;
  9. if(this.m_AniCtrl == null){
  10. this.m_AniCtrl = this.node.getComponent('AniPrefab');
  11. this.m_AniCtrl.Init(this);
  12. }
  13. var AniName = 'dice'+wCount;
  14. this.m_AniCtrl.PlayAni(AniName,1);
  15. },
  16. AniFinish:function(){
  17. var seq = cc.sequence
  18. (
  19. cc.delayTime(1),
  20. cc.callFunc(function()
  21. {
  22. this.node.active = false;
  23. },this)
  24. );
  25. this.node.runAction(seq);
  26. },
  27. });