refactor(animation): 更新动画和预设资源优化表现
- notify.anim 新增位置向量轨迹和关键帧曲线数据,丰富动画表现 - notify.prefab 增加和调整节点、组件及属性,提升UI结构和视觉布局 - hero hc1 的 move.anim 动画时长和帧数据调整,优化动作流畅度 - atk_fires.prefab 添加 withHero 属性以支持技能表现扩展 - 删除了 game/skills 目录下的 buff.prefab 和 buff_iced.prefab 资源,清理无用资源
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { _decorator, Animation, AnimationClip, Component, instantiate, Label, Node, Prefab, resources, Sprite, SpriteFrame, v3, tween, Vec3 } from 'cc';
|
||||
import { oops } from 'db://oops-framework/core/Oops';
|
||||
import { getHeroList, HeroInfo, HType, HTypeName } from '../common/config/heroSet';
|
||||
import { getHeroList, HeroConf, HeroInfo, HType, HTypeName } from '../common/config/heroSet';
|
||||
import { smc } from '../common/SingletonModuleComp';
|
||||
import { GameEvent } from '../common/config/GameEvent';
|
||||
import { CCComp } from 'db://oops-framework/module/common/CCComp';
|
||||
@@ -89,7 +89,7 @@ export class HInfoComp extends CCComp {
|
||||
// 载入英雄预制体并设置位置
|
||||
this.heroNodes[i] = this.load_hui(heroUuid, i);
|
||||
}
|
||||
this.is_lucky()
|
||||
this.show_lock()
|
||||
}
|
||||
load_hui(uuid:number, pos_index: number){
|
||||
var path = "game/gui/hui";
|
||||
@@ -100,7 +100,7 @@ export class HInfoComp extends CCComp {
|
||||
|
||||
// 设置节点位置
|
||||
node.setPosition(this.hero_pos[pos_index]);
|
||||
|
||||
node.setSiblingIndex(0);
|
||||
// 加载并播放动画
|
||||
let anm_path=HeroInfo[uuid].path;
|
||||
resources.load("game/heros/hero/"+anm_path+"/idle", AnimationClip, (err, clip) => {
|
||||
@@ -120,8 +120,12 @@ export class HInfoComp extends CCComp {
|
||||
mission_start(){
|
||||
this.claear_hero()
|
||||
}
|
||||
is_lucky(){
|
||||
this.node.getChildByName("buy").active=!smc.heros.includes(this.h_uuid)
|
||||
is_own(){
|
||||
return smc.heros.includes(this.h_uuid)
|
||||
}
|
||||
show_lock(){
|
||||
this.node.getChildByName("buy").active=!this.is_own()
|
||||
this.node.getChildByName("hero").getChildByName("lock").active=!this.is_own()
|
||||
}
|
||||
claear_hero(){
|
||||
for (let i = 0; i < this.heroNodes.length; i++) {
|
||||
@@ -149,7 +153,7 @@ export class HInfoComp extends CCComp {
|
||||
this.update_data(nextHero);
|
||||
// 执行平滑移动动画
|
||||
this.moveHeroesRight();
|
||||
this.is_lucky()
|
||||
this.show_lock()
|
||||
}
|
||||
|
||||
prev_hero(){
|
||||
@@ -169,14 +173,17 @@ export class HInfoComp extends CCComp {
|
||||
this.update_data(prevHero);
|
||||
// 执行平滑移动动画
|
||||
this.moveHeroesLeft();
|
||||
this.is_lucky()
|
||||
this.show_lock()
|
||||
}
|
||||
buy_hero(){
|
||||
console.info("[HInfoComp]:buy_hero",this.h_uuid)
|
||||
this.node.getChildByName("buy").active=false
|
||||
if(smc.vmdata.gold < HeroConf.COST) {
|
||||
oops.gui.toast("金币不足")
|
||||
return
|
||||
}
|
||||
smc.addHero(this.h_uuid)
|
||||
this.load_all_hero(this.h_uuid)
|
||||
this.is_lucky()
|
||||
this.show_lock()
|
||||
}
|
||||
start_mission() {
|
||||
oops.message.dispatchEvent(GameEvent.MissionStart, {})
|
||||
|
||||
Reference in New Issue
Block a user