添加技能动画
This commit is contained in:
@@ -55,6 +55,7 @@ export class MapViewComp extends CCComp {
|
||||
}
|
||||
protected update(dt: number): void {
|
||||
if (this.monster_refresh_rtimer.update(dt)) {
|
||||
// 刷新怪物定时器
|
||||
this.monster_refresh()
|
||||
}
|
||||
if (this.game_timer.update(dt)) {
|
||||
@@ -63,11 +64,11 @@ export class MapViewComp extends CCComp {
|
||||
// this.shuaxin(dt)
|
||||
this.gold_add(dt)
|
||||
}
|
||||
// 刷新怪物
|
||||
monster_refresh(){
|
||||
if(smc.monsters.length > 0 ){
|
||||
this.addMonster(smc.monsters[0].uuid)
|
||||
}
|
||||
|
||||
}
|
||||
gold_add(dt: number) {
|
||||
smc.vm_data.gold.time += dt;
|
||||
@@ -102,7 +103,4 @@ export class MapViewComp extends CCComp {
|
||||
smc.monsters.splice(0,1)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
import { Component, Node, Prefab, _decorator ,instantiate} from 'cc';
|
||||
import { Timer } from '../../../../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer';
|
||||
import {oops} from "../../../../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import { BoxSet } from '../../../../common/config/BoxSet';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/**
|
||||
@@ -21,9 +22,8 @@ export default class SkillLayer extends Component {
|
||||
@property(Prefab)
|
||||
light: Prefab = null;
|
||||
onLoad(){
|
||||
// 监听全局事件
|
||||
// oops.message.on("monster_load", this.onMonsterLoaded, this);
|
||||
// oops.message.on("hero_load", this.onHeroLoaded, this);
|
||||
oops.message.on("monster_load", this.onMonsterLoaded, this);
|
||||
oops.message.on("hero_load", this.onHeroLoaded, this);
|
||||
|
||||
}
|
||||
onMonsterLoaded(){
|
||||
@@ -32,9 +32,9 @@ export default class SkillLayer extends Component {
|
||||
// this.node.addChild(light);
|
||||
}
|
||||
onHeroLoaded(){
|
||||
// const light = instantiate(this.light);
|
||||
// light.setPosition(-300,-30,0);
|
||||
// this.node.addChild(light);
|
||||
const light = instantiate(this.light);
|
||||
light.setPosition(BoxSet.HERO_START,BoxSet.GAME_LINE,0);
|
||||
this.node.addChild(light);
|
||||
}
|
||||
update(dt: number) {
|
||||
// this.timer.update(dt)
|
||||
|
||||
23
assets/script/game/map/view/map/layer/once.ts
Normal file
23
assets/script/game/map/view/map/layer/once.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { _decorator, Component, Node, sp } from 'cc';
|
||||
const { ccclass, property ,} = _decorator;
|
||||
|
||||
@ccclass('once')
|
||||
export class once extends Component {
|
||||
private spine!: sp.Skeleton;
|
||||
|
||||
start() {
|
||||
|
||||
}
|
||||
protected onLoad(): void {
|
||||
this.spine = this.getComponent(sp.Skeleton)!;
|
||||
this.spine.setCompleteListener(trackEntry => {
|
||||
this.node.destroy()
|
||||
});
|
||||
|
||||
}
|
||||
update(deltaTime: number) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
1
assets/script/game/map/view/map/layer/once.ts.meta
Normal file
1
assets/script/game/map/view/map/layer/once.ts.meta
Normal file
@@ -0,0 +1 @@
|
||||
{"ver":"4.0.23","importer":"typescript","imported":true,"uuid":"6e0a995d-16c1-4554-8f80-29394f24213b","files":[],"subMetas":{},"userData":{}}
|
||||
Reference in New Issue
Block a user