OriginCup.ts 856 B

1234567891011121314151617181920212223242526272829
  1. import { _decorator, Component, Enum, Node } from 'cc';
  2. import { CupHeight } from '../TakeGobletGlobalInstance';
  3. import { LevelAction } from '../LevelAction';
  4. import { EventDispatcher } from 'db://assets/core_tgx/easy_ui_framework/EventDispatcher';
  5. import { GameEvent } from '../Enum/GameEvent';
  6. const { ccclass, property, executeInEditMode } = _decorator;
  7. /** 原浆酒杯组件脚本*/
  8. @ccclass('OriginCup')
  9. @executeInEditMode
  10. export class OriginCup extends Component {
  11. @property({ type: Enum(CupHeight), displayName: '杯高度' })
  12. cupHeight: CupHeight = CupHeight.Two
  13. @property(Node)
  14. waters: Node = null!; //水节点
  15. start() {
  16. this.node.on(Node.EventType.TOUCH_END, () => {
  17. EventDispatcher.instance.emit(GameEvent.EVENT_CLICK_ORIGIN_CUP, this);
  18. });
  19. }
  20. update(deltaTime: number) {
  21. }
  22. }