import { _decorator } from 'cc'; import { GameMgr } from './GameMgr'; import { ModulerBase } from './ModulerBase'; import { MapMgr } from './MapMgr'; const { ccclass, property } = _decorator; @ccclass('Carrot') export class Carrot extends ModulerBase { // @property(GameMgr) // gameMgr: GameMgr = null; start() { const points = this.getModuler(MapMgr).getPath(); const point = points[points.length - 2] this.node.setPosition(point.x, point.y) } update(deltaTime: number) { } }