guid.ts 571 B

123456789101112131415161718
  1. import { _decorator, Component, Mask, Node, UITransform, Vec3, Widget } from 'cc';
  2. const { ccclass, property } = _decorator;
  3. @ccclass('guid')
  4. export class guid extends Component {
  5. @property(Node) btn_click:Node;
  6. @property(Node) mask:Node;
  7. public showGuid(pos:Vec3,call_back,target,size){
  8. this.node.position = pos;
  9. this.node.getComponent(UITransform).contentSize = size;
  10. this.mask.getComponent(Widget).target = target
  11. this.btn_click.on(Node.EventType.TOUCH_END,()=>{
  12. call_back()
  13. },this.btn_click)
  14. }
  15. }