ddd
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* @LastEditors: dgflash
|
||||
* @LastEditTime: 2022-08-04 15:43:04
|
||||
*/
|
||||
import { instantiate, Node, Prefab, Vec3 ,tween, v3,Collider2D,Contact2DType,PhysicsSystem2D,IPhysics2DContact, animation,Label} from "cc";
|
||||
import { instantiate, Node, Prefab, Vec3 ,tween, v3,Collider2D,Contact2DType,PhysicsSystem2D,IPhysics2DContact, animation,Label,resources,SpriteFrame,Sprite} from "cc";
|
||||
import { UICallbacks } from "../../../../extensions/oops-plugin-framework/assets/core/gui/layer/Defines";
|
||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
@@ -46,6 +46,15 @@ export class Monster extends ecs.Entity {
|
||||
|
||||
node.getChildByName("avatar").setScale(node.getChildByName("avatar").scale.x*camp, node.getChildByName("avatar").scale.y, node.getChildByName("avatar").scale.z);
|
||||
node.setPosition(pos)
|
||||
console.log(node.getChildByName("avatar").getChildByName("TNode").getChildByName("bb").getComponent(Sprite))
|
||||
const url = 'game/heros/hero/'+name+'/spriteFrame';
|
||||
resources.load(url, SpriteFrame, (err: any, spriteFrame) => {
|
||||
const sprite = node.getChildByName("avatar").getChildByName("TNode").getChildByName("bb").getComponent(Sprite);
|
||||
|
||||
sprite.spriteFrame = spriteFrame;
|
||||
});
|
||||
|
||||
|
||||
var mv = node.getComponent(MonsterViewComp)!;
|
||||
mv.speed =mv.ospeed = speed;
|
||||
mv.hero_name= name;
|
||||
|
||||
@@ -97,11 +97,11 @@ export class MonsterViewComp extends CCComp {
|
||||
this.as = this.getComponent(MonsterSpine);
|
||||
|
||||
// console.log('hero load ent:',this);
|
||||
PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb |
|
||||
EPhysics2DDrawFlags.Pair |
|
||||
EPhysics2DDrawFlags.CenterOfMass |
|
||||
EPhysics2DDrawFlags.Joint |
|
||||
EPhysics2DDrawFlags.Shape;
|
||||
// PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb |
|
||||
// EPhysics2DDrawFlags.Pair |
|
||||
// EPhysics2DDrawFlags.CenterOfMass |
|
||||
// EPhysics2DDrawFlags.Joint |
|
||||
// EPhysics2DDrawFlags.Shape;
|
||||
}
|
||||
change_name(hero_name:string='hero',camp:number=1){
|
||||
this.name=hero_name;
|
||||
|
||||
Reference in New Issue
Block a user