bItem.js 692 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. item: cc.Node
  5. },
  6. // LIFE-CYCLE CALLBACKS:
  7. // onLoad () {},
  8. init (bottle) {
  9. this.bottle = bottle
  10. },
  11. onCollisionEnter (other, self) {
  12. // this.getComponent(cc.Animation).play();
  13. this.scheduleOnce(() => {
  14. this.bottle.doEnterCtrl();
  15. }, 0.1)
  16. },
  17. showGold () {
  18. this.item.active = true;
  19. this.item.y = 150;
  20. },
  21. showSubline () {
  22. this.item.active = true;
  23. this.item.y = 144;
  24. },
  25. showHit () {
  26. this.item.active = true;
  27. this.item.y = 150;
  28. },
  29. start () {
  30. },
  31. // update (dt) {},
  32. });