修复BUG

This commit is contained in:
MuHua-123
2025-01-17 12:13:18 +08:00
parent 98187f2ced
commit 7f4071505d
9 changed files with 32 additions and 66 deletions
+21
View File
@@ -0,0 +1,21 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// 单例模块
/// </summary>
public abstract class ModuleSingle<T> : MonoBehaviour where T : ModuleSingle<T> {
/// <summary> 模块单例 </summary>
public static T I => instance;
/// <summary> 模块单例 </summary>
protected static T instance;
/// <summary> 核心模块 </summary>
protected virtual ModuleCore ModuleCore => ModuleCore.I;
/// <summary> 初始化 </summary>
protected virtual void Awake() {
if (instance != null) { Destroy(instance.gameObject); }
instance = (T)this;
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 121ca341c2100df4b94d707ed24452f5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: