MoveToCenter.ts 460 B

12345678910111213141516
  1. import { MapMove } from './MapMove';
  2. const { ccclass, property } = cc._decorator;
  3. /**
  4. * @description 使地图中的节点快速移动到视角中心
  5. * @author Soonsky
  6. */
  7. @ccclass
  8. export class MoveToCenter extends cc.Component {
  9. @property({ type: MapMove, tooltip: "地图移动控件" }) mapMove: MapMove = null;
  10. public move(position?: cc.Vec3): void {
  11. return
  12. this.mapMove.moveTo(position ? position : this.node.position);
  13. }
  14. }