mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-12-14 00:39:16 +00:00
update 添加松鼠角色
This commit is contained in:
@@ -2,12 +2,14 @@ import { Vec2 } from "cc";
|
||||
import GObject from "./base/GObject";
|
||||
import { v3 } from "cc";
|
||||
import { JNFrameInfo } from "../../../extensions/ngame/assets/ngame/sync/frame/JNSyncFrame";
|
||||
import { Node } from "cc";
|
||||
import { Vec3 } from "cc";
|
||||
|
||||
|
||||
export default class GBaseMode<T> extends GObject<T> {
|
||||
|
||||
//添加对象到场景中
|
||||
addGObject(obj: GObject<{}>,pos?:Vec2){
|
||||
addGObject(obj: GObject<{}>,pos?:Vec2 | Vec3){
|
||||
obj.mode = this;
|
||||
this.node.addChild(obj.node);
|
||||
if(pos){
|
||||
@@ -15,6 +17,14 @@ export default class GBaseMode<T> extends GObject<T> {
|
||||
}
|
||||
}
|
||||
|
||||
//添加Node到场景中
|
||||
addGNode(obj:Node,pos?:Vec2 | Vec3){
|
||||
this.node.addChild(obj);
|
||||
if(pos){
|
||||
obj.setWorldPosition(v3(pos.x,pos.y,0));
|
||||
}
|
||||
}
|
||||
|
||||
onSyncUpdate(dt: number,frame:JNFrameInfo, input?: T) {
|
||||
|
||||
//重置 场景中的层级
|
||||
|
||||
Reference in New Issue
Block a user