添加技能动画

This commit is contained in:
2024-08-20 13:35:13 +08:00
parent dd4ec69fb6
commit 87a445c225
34 changed files with 1849 additions and 30 deletions

View File

@@ -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)
}
}

View File

@@ -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)

View 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) {
}
}

View File

@@ -0,0 +1 @@
{"ver":"4.0.23","importer":"typescript","imported":true,"uuid":"6e0a995d-16c1-4554-8f80-29394f24213b","files":[],"subMetas":{},"userData":{}}