CocosCyberpunk/assets/scripts/logic/actor/level-enable-play.ts

16 lines
435 B
TypeScript
Raw Normal View History

2023-02-22 09:50:51 +08:00
import { _decorator, Component, animation } from 'cc';
import { Level } from '../level/level';
import { Game } from '../data/game';
const { ccclass, property } = _decorator;
@ccclass('LevelEnablePlay')
export class LevelEnablePlay extends Component {
onEnable() {
if (Game.Instance._currentGameNodeName !== 'level') {
this.node.getComponent(animation.AnimationController)!.enabled = false;
}
}
}