|
@@ -11,6 +11,7 @@ export default class UEBattleRole extends UERole {
|
|
m_IsLoadComplete: boolean;
|
|
m_IsLoadComplete: boolean;
|
|
team: FightTeam;
|
|
team: FightTeam;
|
|
type: FightType;
|
|
type: FightType;
|
|
|
|
+ posX: number;
|
|
|
|
|
|
onLoad() {
|
|
onLoad() {
|
|
this.m_ResSpine = this.node.getChildByName("spine").getComponent(ResSpine);
|
|
this.m_ResSpine = this.node.getChildByName("spine").getComponent(ResSpine);
|
|
@@ -24,12 +25,13 @@ export default class UEBattleRole extends UERole {
|
|
this.team = team;
|
|
this.team = team;
|
|
this.type = type;
|
|
this.type = type;
|
|
this.node.x = posX;
|
|
this.node.x = posX;
|
|
|
|
+ this.posX = posX;
|
|
this.LoadRoleRes();
|
|
this.LoadRoleRes();
|
|
}
|
|
}
|
|
|
|
|
|
GetSpinePath() {
|
|
GetSpinePath() {
|
|
let spinePath = "role/nv";
|
|
let spinePath = "role/nv";
|
|
- if (this.team?.fid == "20") {
|
|
|
|
|
|
+ if (this.team?.fid == "1022") {
|
|
spinePath = "mon/10001";
|
|
spinePath = "mon/10001";
|
|
}
|
|
}
|
|
return spinePath;
|
|
return spinePath;
|
|
@@ -44,7 +46,7 @@ export default class UEBattleRole extends UERole {
|
|
if (asset) {
|
|
if (asset) {
|
|
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
|
|
|
|
if (that.m_ResSpine && that.m_ResSpine.isValid) {
|
|
if (that.m_ResSpine && that.m_ResSpine.isValid) {
|
|
that.m_ResSpine.addEventListener(that.OnEventListener.bind(that));
|
|
that.m_ResSpine.addEventListener(that.OnEventListener.bind(that));
|
|
@@ -55,15 +57,19 @@ export default class UEBattleRole extends UERole {
|
|
}, false, "stand", true, 1);
|
|
}, false, "stand", true, 1);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ playAni(aniName: string, loop: boolean, showLast?: boolean) {
|
|
|
|
+ this.m_ResSpine.playAnimation(aniName, loop, showLast);
|
|
|
|
+ }
|
|
|
|
+
|
|
/** 监听事件帧 */
|
|
/** 监听事件帧 */
|
|
OnEventListener(name: string) {
|
|
OnEventListener(name: string) {
|
|
// console.log("角色事件帧", name);
|
|
// console.log("角色事件帧", name);
|
|
if (name === "skill" || name === "atk") {
|
|
if (name === "skill" || name === "atk") {
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
OnCompleteListener(name: string) {
|
|
OnCompleteListener(name: string) {
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|