FPickGood.ts 1005 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import FqLogin from "../../../login/FqLogin";
  2. import FSprite from "../object/FSprite";
  3. import BaseEvent from "./base/BaseEvent";
  4. /**
  5. * 捡任务道具
  6. */
  7. const {ccclass, property} = cc._decorator;
  8. @ccclass
  9. export default class FPickGood extends BaseEvent {
  10. @property({
  11. displayName: '捡起的物品id'
  12. })
  13. public goodId = 2002;
  14. onLoad(){
  15. super.onLoad()
  16. this.node.zIndex = 9999;
  17. }
  18. public onBegin(tag:number){
  19. this.node.removeComponent(cc.PhysicsBoxCollider);
  20. let header = this.ff.mFFheader;
  21. header.addTmpGood(this.goodId,1);
  22. cc.tween(this.node).sequence(
  23. cc.spawn(
  24. cc.moveBy(1, cc.v2(0, 200)).easing(cc.easeSineOut()),
  25. cc.fadeOut(1)
  26. ),
  27. cc.callFunc(()=>{
  28. FqLogin.commitEvent(this.node.name,'','');
  29. this.node.removeFromParent(true);
  30. this.node.destroy();
  31. })
  32. ).start();
  33. }
  34. }