假期修改
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { _decorator, Component, Node, sp ,Animation, AnimationState} from 'cc';
|
||||
import { _decorator, Component, Node, sp ,Animation, AnimationState, animation, AnimationClip} from 'cc';
|
||||
import { Timer } from '../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer';
|
||||
const { ccclass, property ,} = _decorator;
|
||||
|
||||
@@ -6,17 +6,18 @@ const { ccclass, property ,} = _decorator;
|
||||
export class anonce extends Component {
|
||||
|
||||
timer:Timer=new Timer(0.5);
|
||||
anm_clip: AnimationClip = null!;
|
||||
|
||||
start() {
|
||||
|
||||
}
|
||||
protected onLoad(): void {
|
||||
|
||||
this.anm_clip = this.node.getChildByName("skill").getComponent(Animation).clips[0];
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
if(this.node.active){
|
||||
if(!this.node.getChildByName("skill").getComponent(Animation).getState("heathed").isPlaying){
|
||||
if(!this.node.getChildByName("skill").getComponent(Animation).getState(this.anm_clip.name).isPlaying){
|
||||
this.node.getChildByName("skill").getComponent(Animation).play();
|
||||
}
|
||||
if (this.timer.update(deltaTime)) {
|
||||
|
||||
Reference in New Issue
Block a user