mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-11-08 07:16:08 +00:00
update
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { Vec2 } from "cc";
|
||||
import { JNGSyncProtoBase } from "../../App";
|
||||
import GBaseMode from "../GBaseMode";
|
||||
import { v2 } from "cc";
|
||||
|
||||
|
||||
export default class GObject<T> extends JNGSyncProtoBase<T>{
|
||||
@@ -14,5 +16,17 @@ export default class GObject<T> extends JNGSyncProtoBase<T>{
|
||||
this._mode = value;
|
||||
}
|
||||
|
||||
//设置镜像
|
||||
static SetMirror(role:GObject<{}>,flipX:boolean = true,flipY:boolean = false){
|
||||
let node = role.node;
|
||||
node.setScale(flipX ? -Math.abs(node.scale.x) : Math.abs(node.scale.x),flipY ? -Math.abs(node.scale.y) : Math.abs(node.scale.y))
|
||||
}
|
||||
|
||||
//获取v2世界坐标
|
||||
get v2World():Vec2{
|
||||
let world = this.node.worldPosition;
|
||||
return v2(world.x,world.y);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user