CocosCyberpunk/assets/test/test-taa.ts
2023-02-22 09:50:51 +08:00

23 lines
449 B
TypeScript

import { _decorator, Component, Node, instantiate } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('test_taa')
export class test_taa extends Component {
@property(Node)
temp: Node | undefined
start () {
if (!this.temp) return;
globalThis.test_taa = this;
}
create () {
let temp = instantiate(this.temp)!
temp.parent = this.node.parent
this.node.active = false
}
}