| 1234567891011121314151617181920212223242526 |
- import { _decorator, Component } from 'cc';
- const { ccclass, property } = _decorator;
- /**
- * 武器方块示例脚本
- * 展示如何使用ConfigManager来创建带有武器配置的方块
- */
- @ccclass('WeaponBlockExample')
- export class WeaponBlockExample extends Component {
- private static _instance: WeaponBlockExample = null;
- onLoad() {
- WeaponBlockExample._instance = this;
- }
- onDestroy() {
- if (WeaponBlockExample._instance === this) {
- WeaponBlockExample._instance = null;
- }
- }
- public static getInstance(): WeaponBlockExample {
- return WeaponBlockExample._instance;
- }
- }
|