fix: 更新提交
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-console */
|
||||
import { _decorator, Component, director } from "cc";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
@@ -30,9 +29,7 @@ export class DontDestroy extends Component {
|
||||
*/
|
||||
private makePersistent(): void {
|
||||
if (this._isPersistent) {
|
||||
console.warn(
|
||||
`DontDestroy: 节点 ${this.node.name} 已经是常驻节点,无需重复设置`,
|
||||
);
|
||||
console.warn(`DontDestroy: 节点 ${this.node.name} 已经是常驻节点,无需重复设置`);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -49,9 +46,7 @@ export class DontDestroy extends Component {
|
||||
*/
|
||||
public removePersistent(): void {
|
||||
if (!this._isPersistent) {
|
||||
console.warn(
|
||||
`DontDestroy: 节点 ${this.node.name} 不是常驻节点,无需移除`,
|
||||
);
|
||||
console.warn(`DontDestroy: 节点 ${this.node.name} 不是常驻节点,无需移除`);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -59,9 +54,7 @@ export class DontDestroy extends Component {
|
||||
director.removePersistRootNode(this.node);
|
||||
this._isPersistent = false;
|
||||
|
||||
console.log(
|
||||
`DontDestroy: 节点 ${this.node.name} 已从常驻节点列表中移除`,
|
||||
);
|
||||
console.log(`DontDestroy: 节点 ${this.node.name} 已从常驻节点列表中移除`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user