/** * 藤蔓 */ import { _decorator, Component, sp } from 'cc'; const { ccclass, property } = _decorator; @ccclass('SingleVineGrass') export class SingleVineGrass extends Component { start() { this.init(); } init() { let spine = this.node.getChildByName('anim') spine.getComponent(sp.Skeleton).setAnimation(0, '藤曼出现', false) this.scheduleOnce(() => { spine.getComponent(sp.Skeleton).setAnimation(0, '藤曼待机', true) }, 3) } protected onDisable(): void { this.unscheduleAllCallbacks(); } protected onDestroy(): void { this.unscheduleAllCallbacks(); } }