You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
675 B
33 lines
675 B
|
1 week ago
|
/**
|
||
|
|
* 藤蔓
|
||
|
|
*/
|
||
|
|
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();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|