import { _decorator, Component, EventTouch, Node, Vec2 } from 'cc'; import { RoleList } from './RoleList'; import { resMgr } from '../../Frames/ResourcesMgr'; import { CharacterSlotMgr } from './CharacterSlotMgr'; const { ccclass, property } = _decorator; @ccclass('TouchMgr') export class TouchMgr extends Component { movePos: Vec2 = null; protected onLoad(): void { } start() { this.node.on(Node.EventType.TOUCH_START, (e: EventTouch) => { //pos 为 世界坐标系下的坐标,以左下角为原点(0,0) const pos = e.getUILocation(); this.func(pos); }) this.node.on(Node.EventType.TOUCH_MOVE, (e: EventTouch) => { const pos = e.getUILocation(); this.movePos = pos; }) } func(pos: Vec2) { } }