This commit is contained in:
MuHua-123
2025-01-08 18:02:44 +08:00
parent a08bd06617
commit 8f387837db
46 changed files with 5196 additions and 117 deletions
@@ -0,0 +1,26 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// 数据处理器模块
/// </summary>
public class ModuleHandle<T> {
/// <summary> 数据 </summary>
protected T value;
/// <summary> 核心模块 </summary>
protected virtual ModuleCore ModuleCore => ModuleCore.I;
/// <summary> 当前数据 </summary>
public virtual T Current => value;
/// <summary> 当前数据是否有效 </summary>
public virtual bool IsValid => Current != null;
/// <summary> 改变当前数据 Event </summary>
public virtual event Action<T> OnChange;
/// <summary> 改变当前数据 </summary>
public virtual void Change() => OnChange?.Invoke(value);
/// <summary> 改变当前数据 </summary>
public virtual void Change(T value) {this.value = value; OnChange?.Invoke(value); }
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 73ab810e12f76f449ba3e6351467ebcb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: