修改了 spine 为缓存模式
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
import { _decorator, CCClass, Component, sp,Animation} from "cc";
|
||||
import { FightSet } from "../common/config/Mission";
|
||||
import { FacSet } from "../common/config/BoxSet";
|
||||
import { HeroViewComp } from "./HeroViewComp";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('HeroAnmComp')
|
||||
@@ -15,17 +18,19 @@ export default class HeroAnmComp extends Component{
|
||||
this.is_spine=true
|
||||
this.spine=this.getComponent('sp.Skeleton') as sp.Skeleton;
|
||||
var spine = this.spine = this.getComponent('sp.Skeleton') as sp.Skeleton;
|
||||
this._setMix('Walking', 'Idle');
|
||||
this._setMix('Walking', 'Attacking');
|
||||
this._setMix('Walking', 'Taunt');
|
||||
this._setMix('Idle', 'Attacking');
|
||||
this._setMix('Idle', 'Taunt');
|
||||
this._setMix('Idle', 'Walking');
|
||||
this._setMix('Attacking', 'Idle');
|
||||
this._setMix('Attacking', 'Walking');
|
||||
this._setMix('Taunt', 'Walking');
|
||||
this._setMix('Taunt', 'Idle');
|
||||
|
||||
if(this.node.parent.getComponent(HeroViewComp).fac==1){
|
||||
console.log('hero parent',this.node.parent.getComponent(HeroViewComp))
|
||||
this._setMix('Walking', 'Idle');
|
||||
this._setMix('Walking', 'Attacking');
|
||||
this._setMix('Walking', 'Taunt');
|
||||
this._setMix('Idle', 'Attacking');
|
||||
this._setMix('Idle', 'Taunt');
|
||||
this._setMix('Idle', 'Walking');
|
||||
this._setMix('Attacking', 'Idle');
|
||||
this._setMix('Attacking', 'Walking');
|
||||
this._setMix('Taunt', 'Walking');
|
||||
this._setMix('Taunt', 'Idle');
|
||||
}
|
||||
spine.setCompleteListener((trackEntry) => {
|
||||
var animationName = trackEntry.animation ? trackEntry.animation.name : "";
|
||||
if (animationName === 'Attacking'||animationName==='Taunt'||animationName==='Hurt') {
|
||||
|
||||
@@ -109,7 +109,7 @@ export class HeroViewComp extends CCComp {
|
||||
delay: number
|
||||
}> = [];
|
||||
private isProcessingDamage: boolean = false;
|
||||
private damageInterval: number = 0.2; // 伤害数字显示间隔
|
||||
private damageInterval: number = 0.01; // 伤害数字显示间隔
|
||||
|
||||
private timer:Timer=new Timer(1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user