继续游戏模式改变,不再是原先的肉鸽单局,而是闯关轻成长
This commit is contained in:
35
assets/script/game/map/HeroReadyCom.ts
Normal file
35
assets/script/game/map/HeroReadyCom.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { _decorator, Animation, AnimationClip, CCInteger, Component, Node, resources } from 'cc';
|
||||
import { smc } from '../common/SingletonModuleComp';
|
||||
import { HeroInfo } from '../common/config/heroSet';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('HeroReadyCom')
|
||||
export class HeroReadyCom extends Component {
|
||||
@property(CCInteger)
|
||||
slot: number=0;
|
||||
|
||||
start() {
|
||||
this.update_hero()
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
|
||||
}
|
||||
update_hero(){
|
||||
let hero = smc.fight_heros[this.slot]
|
||||
if(hero==0){
|
||||
return
|
||||
}
|
||||
let hero_data = HeroInfo[hero]
|
||||
console.log("[HeroReadyCom]hero_data",smc.fight_heros,hero,smc.fight_heros[this.slot],this.slot,hero_data)
|
||||
let anm_path=hero_data.path
|
||||
resources.load("game/heros/hero/"+anm_path+"/idle", AnimationClip, (err, clip) => {
|
||||
this.node.getChildByName("icon").getComponent(Animation).addClip(clip);
|
||||
this.node.getChildByName("icon").getComponent(Animation).play("idle");
|
||||
});
|
||||
// console.log("[HeroReadyCom]clip",this.node.getChildByName("icon").getComponent(Animation))
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user