role 也转为使用hero 预制体
This commit is contained in:
@@ -38,16 +38,12 @@ export class Hero extends ecs.Entity {
|
||||
}
|
||||
|
||||
/** 加载角色 */
|
||||
load(pos: Vec3 = Vec3.ZERO,scale:number = 1,uuid:number=1001) {
|
||||
load(pos: Vec3 = Vec3.ZERO,scale:number = 1,uuid:number=1001,layer:Node=smc.map.MapView.scene.entityLayer!.node!) {
|
||||
// var path = "game/monster/"+prefab_path;
|
||||
var path = "game/heros/hero";
|
||||
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
var scene = smc.map.MapView.scene;
|
||||
node.parent = scene.entityLayer!.node!;
|
||||
// var as = node.getComponent(MonsterSpine);
|
||||
|
||||
node.parent=layer
|
||||
let ratio=this.set_ratio(uuid);
|
||||
node.setScale(ratio*node.scale.x, ratio*node.scale.y, node.scale.z);
|
||||
|
||||
@@ -76,8 +72,8 @@ export class Hero extends ecs.Entity {
|
||||
ratio=1.3
|
||||
break;
|
||||
case 5:
|
||||
ratio=1.4
|
||||
break;
|
||||
ratio=1.4
|
||||
break;
|
||||
default:
|
||||
ratio=1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user