This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2023-10-31 02:34:12 +08:00
parent 94fa409ed7
commit e59c5640d7
324 changed files with 1388 additions and 407 deletions

View File

@@ -8,10 +8,14 @@ import { Vec3 } from "cc";
export default class GBaseMode<T> extends GObject<T> {
get scene():Node{
return this.node;
}
//添加对象到场景中
addGObject(obj: GObject<{}>,pos?:Vec2 | Vec3){
obj.mode = this;
this.node.addChild(obj.node);
this.scene.addChild(obj.node);
if(pos){
obj.node.setWorldPosition(v3(pos.x,pos.y,0));
}
@@ -19,7 +23,7 @@ export default class GBaseMode<T> extends GObject<T> {
//添加Node到场景中
addGNode(obj:Node,pos?:Vec2 | Vec3){
this.node.addChild(obj);
this.scene.addChild(obj);
if(pos){
obj.setWorldPosition(v3(pos.x,pos.y,0));
}