diff --git a/Assets/Unity-Tools/Core/EasyPool.meta b/Assets/Unity-Tools/Core/EasyPool.meta new file mode 100644 index 0000000..ec8c402 --- /dev/null +++ b/Assets/Unity-Tools/Core/EasyPool.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 56a3c8fd9caf0c546b1bfb8443e15ff5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Unity-Tools/Core/EasyPool/Core.meta b/Assets/Unity-Tools/Core/EasyPool/Core.meta new file mode 100644 index 0000000..7c0a690 --- /dev/null +++ b/Assets/Unity-Tools/Core/EasyPool/Core.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: b13727d858ad440da9f62b35a9db05b6 +timeCreated: 1735826401 \ No newline at end of file diff --git a/Assets/Unity-Tools/Core/EasyPool/Core/IAbstractPool.cs b/Assets/Unity-Tools/Core/EasyPool/Core/IAbstractPool.cs new file mode 100644 index 0000000..0ca50a2 --- /dev/null +++ b/Assets/Unity-Tools/Core/EasyPool/Core/IAbstractPool.cs @@ -0,0 +1,56 @@ +using System; +using UnityEngine; + +namespace Tools.EasyPoolKit +{ + public interface ISimpleGameObjectPool : IAbstractPool { } + + public interface IRecyclablePool : IAbstractPool where T : class, IRecyclable { } + + public interface IAbstractPool where T : class + { + RecycleObjectType ObjectType { get; } + + Type ReferenceType { get; } + + string PoolId { get; } + + int? InitCreateCount { get; } + + int? MaxSpawnCount { get; } + + int? MaxDespawnCount { get; } + + float? AutoClearTime { get; } + + Func SpawnFunc { get; set; } + + PoolReachMaxLimitType ReachMaxLimitType { get; } + + PoolDespawnDestroyType DespawnDestroyType { get; } + + PoolClearType ClearType { get; } + + bool IfIgnoreTimeScale { get; } + + int GetCachedObjectCount(); + + int GetUsedObjectCount(); + + int GetTotalObjectCount(); + + T SpawnObject(); + + bool TrySpawnObject(out T newObj); + + bool DespawnObject(T usedObj); + + void ClearUnusedObjects(); + + void ClearAll(); + + void OnPoolUpdate(float deltaTime); + + RecyclablePoolInfo GetPoolInfoReadOnly(); + } +} \ No newline at end of file diff --git a/Assets/Unity-Tools/Core/EasyPool/Core/IAbstractPool.cs.meta b/Assets/Unity-Tools/Core/EasyPool/Core/IAbstractPool.cs.meta new file mode 100644 index 0000000..0a54653 --- /dev/null +++ b/Assets/Unity-Tools/Core/EasyPool/Core/IAbstractPool.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 572ab46ede5648ed9221a8d0a59980da +timeCreated: 1735826434 \ No newline at end of file diff --git a/Assets/Unity-Tools/Core/EasyPool/Core/IRecyclable.cs b/Assets/Unity-Tools/Core/EasyPool/Core/IRecyclable.cs new file mode 100644 index 0000000..e9af4a6 --- /dev/null +++ b/Assets/Unity-Tools/Core/EasyPool/Core/IRecyclable.cs @@ -0,0 +1,25 @@ +namespace Tools.EasyPoolKit +{ + public interface IRecyclable + { + RecycleObjectType ObjectType { get; } + + string PoolId { get; set; } + + int ObjectId { get; set; } + + string Name { get; set; } + + float UsedTime { get; set; } + + void OnObjectInit(); + + void OnObjectDeInit(); + + void OnObjectSpawn(); + + void OnObjectDespawn(); + + void OnObjectUpdate(float deltaTime); + } +} \ No newline at end of file diff --git a/Assets/Unity-Tools/Core/EasyPool/Core/IRecyclable.cs.meta b/Assets/Unity-Tools/Core/EasyPool/Core/IRecyclable.cs.meta new file mode 100644 index 0000000..32b1aa1 --- /dev/null +++ b/Assets/Unity-Tools/Core/EasyPool/Core/IRecyclable.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 0162baae017243bd903260d3037933c3 +timeCreated: 1735828321 \ No newline at end of file diff --git a/Assets/Unity-Tools/Core/EasyPool/Core/PoolParamTypes.cs b/Assets/Unity-Tools/Core/EasyPool/Core/PoolParamTypes.cs new file mode 100644 index 0000000..a7c18ef --- /dev/null +++ b/Assets/Unity-Tools/Core/EasyPool/Core/PoolParamTypes.cs @@ -0,0 +1,37 @@ +namespace Tools.EasyPoolKit +{ + /// + /// 当用户试图获取一个对象,但池达到最大计数 + /// Default =>创建新对象并返回 + /// RejectNull =>不创建新对象并返回null + /// Recycleold => 强制回收最老的并返回,注意:该物体不会执行回收方法 + /// + public enum PoolReachMaxLimitType + { + Default, //无限制 + RejectNull, + RecycleOldest, + } + + /// + /// 当对象返回给池时,如果池大小大于最大影藏的最大值 + /// 默认值 => 什么也不做 + /// DestroyToLimit => 销毁对象,使池大小等于限制 + /// + public enum PoolDespawnDestroyType + { + Default, //Not destroy + DestroyToLimit, + } + + /// + /// 当清除池时 + /// Default => 清除所有 + /// ClearToLimit => 清楚掉多余的对象,使池大小等于初始化大小 + /// + public enum PoolClearType + { + Default, //Clear all + ClearToLimit, + } +} \ No newline at end of file diff --git a/Assets/Unity-Tools/Core/EasyPool/Core/PoolParamTypes.cs.meta b/Assets/Unity-Tools/Core/EasyPool/Core/PoolParamTypes.cs.meta new file mode 100644 index 0000000..5455343 --- /dev/null +++ b/Assets/Unity-Tools/Core/EasyPool/Core/PoolParamTypes.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 5f47fcfc58b34733ab5722f55e4b0365 +timeCreated: 1735826663 \ No newline at end of file diff --git a/Assets/Unity-Tools/Core/EasyPool/Core/RecyclablePoolConfig.cs b/Assets/Unity-Tools/Core/EasyPool/Core/RecyclablePoolConfig.cs new file mode 100644 index 0000000..e2aa301 --- /dev/null +++ b/Assets/Unity-Tools/Core/EasyPool/Core/RecyclablePoolConfig.cs @@ -0,0 +1,21 @@ +using System; + +namespace Tools.EasyPoolKit +{ + public sealed class RecyclablePoolConfig + { + public RecycleObjectType ObjectType = RecycleObjectType.Object; + public Type ReferenceType; + public string PoolId = string.Empty; + public Func SpawnFunc; + public int? InitCreateCount = null; + public PoolReachMaxLimitType ReachMaxLimitType = PoolReachMaxLimitType.Default; + public int? MaxSpawnCount = null; + public PoolDespawnDestroyType DespawnDestroyType = PoolDespawnDestroyType.Default; + public int? MaxDespawnCount = null; + public PoolClearType ClearType = PoolClearType.Default; + public float? AutoClearTime = null; + public bool IfIgnoreTimeScale = false; + public object[] ExtraArgs = Array.Empty(); + } +} \ No newline at end of file diff --git a/Assets/Unity-Tools/Core/EasyPool/Core/RecyclablePoolConfig.cs.meta b/Assets/Unity-Tools/Core/EasyPool/Core/RecyclablePoolConfig.cs.meta new file mode 100644 index 0000000..435dfef --- /dev/null +++ b/Assets/Unity-Tools/Core/EasyPool/Core/RecyclablePoolConfig.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7bc83b44cc14470ab86d28ae6357d1cf +timeCreated: 1735829435 \ No newline at end of file diff --git a/Assets/Unity-Tools/Core/EasyPool/Core/RecyclablePoolInfo.cs b/Assets/Unity-Tools/Core/EasyPool/Core/RecyclablePoolInfo.cs new file mode 100644 index 0000000..ebff318 --- /dev/null +++ b/Assets/Unity-Tools/Core/EasyPool/Core/RecyclablePoolInfo.cs @@ -0,0 +1,108 @@ +using System; + +namespace Tools.EasyPoolKit +{ + public sealed class RecyclablePoolInfo + { + public RecycleObjectType ObjectType { get; private set; } = RecycleObjectType.Object; + public Type ReferenceType { get; private set; } + public string PoolId { get; private set; } = string.Empty; + public int? InitCreateCount { get; private set; } = null; + public PoolReachMaxLimitType ReachMaxLimitType { get; private set; } = PoolReachMaxLimitType.Default; + public int? MaxSpawnCount { get; private set; } = null; + public PoolDespawnDestroyType DespawnDestroyType { get; private set; } = PoolDespawnDestroyType.Default; + public int? MaxDespawnCount { get; private set; } = null; + public PoolClearType ClearType { get; private set; } = PoolClearType.Default; + public float? AutoClearTime { get; private set; } = null; + public bool IfIgnoreTimeScale { get; private set; } = false; + + public int CachedObjectCount => _getCachedCount?.Invoke() ?? 0; + + public int UsedObjectCount => _getUsedCount?.Invoke() ?? 0; + + public int TotalObjectCount => _getTotalCount?.Invoke() ?? 0; + + public object ExtraInfo { get; private set; } = null; + + private Func _getCachedCount; + + private Func _getUsedCount; + + private Func _getTotalCount; + + public RecyclablePoolInfo(RecyclablePoolConfig config, + Func getCachedCount, + Func getUsedCount, + Func getTotalCount, + object extraInfo) + { + _getCachedCount = getCachedCount; + _getUsedCount = getUsedCount; + _getTotalCount = getTotalCount; + ObjectType = config.ObjectType; + ReferenceType = config.ReferenceType; + PoolId = config.PoolId; + InitCreateCount = config.InitCreateCount; + ReachMaxLimitType = config.ReachMaxLimitType; + MaxSpawnCount = config.MaxSpawnCount; + DespawnDestroyType = config.DespawnDestroyType; + MaxDespawnCount = config.MaxDespawnCount; + ClearType = config.ClearType; + AutoClearTime = config.AutoClearTime; + IfIgnoreTimeScale = config.IfIgnoreTimeScale; + + _getCachedCount = getCachedCount; + _getUsedCount = getUsedCount; + _getTotalCount = getTotalCount; + ExtraInfo = extraInfo; + } + + public string GetDebugConfigInfo() + { +#if EASY_POOL_DEBUG + var stringBuilder = new System.Text.StringBuilder(); + stringBuilder.Append("RecyclablePoolInfo == ConfigInfo\n") + .Append("PoolID:").Append(PoolId).Append('\n') + .Append("ObjectType:").Append(ObjectType.ToString()).Append('\n') + .Append("ReferenceType:").Append(ReferenceType.ToString()).Append('\n') + .Append("==========").Append(ReferenceType.ToString()).Append('\n') + .Append("InitCreateCount:").Append(InitCreateCount.HasValue ? InitCreateCount.Value.ToString() : "-").Append('\n') + .Append("==========").Append(ReferenceType.ToString()).Append('\n') + .Append("ReachMaxLimitType:").Append(ReachMaxLimitType.ToString()).Append('\n') + .Append("MaxSpawnCount:").Append(MaxSpawnCount.HasValue ? MaxSpawnCount.Value.ToString() : "-").Append('\n') + .Append("==========").Append(ReferenceType.ToString()).Append('\n') + .Append("DespawnDestroyType:").Append(DespawnDestroyType.ToString()).Append('\n') + .Append("MaxDespawnCount:").Append(MaxDespawnCount.HasValue ? MaxDespawnCount.Value.ToString() : "-").Append('\n') + .Append("==========").Append(ReferenceType.ToString()).Append('\n') + .Append("ClearType:").Append(ClearType.ToString()).Append('\n') + .Append("==========").Append(ReferenceType.ToString()).Append('\n') + .Append("AutoClearTime:").Append((AutoClearTime.HasValue ? AutoClearTime.Value.ToString() : "-")).Append('\n') + .Append("==========").Append(ReferenceType.ToString()).Append('\n') + .Append("IfIgnoreTimeScale:").Append(IfIgnoreTimeScale.ToString()).Append('\n'); + + return stringBuilder.ToString(); +#else + return string.Empty; +#endif + } + + public string GetDebugRunningInfo() + { +#if EASY_POOL_DEBUG + var stringBuilder = new System.Text.StringBuilder(); + stringBuilder.Append("RecyclablePoolInfo == RunningInfo\n") + .Append("PoolID:").Append(PoolId).Append('\n') + .Append("ObjectType:").Append(ObjectType.ToString()).Append('\n') + .Append("ReferenceType:").Append(ReferenceType.ToString()).Append('\n') + .Append("==========").Append(ReferenceType.ToString()).Append('\n') + .Append("CachedObjectCount:").Append(CachedObjectCount).Append('/').Append(TotalObjectCount).Append('\n') + .Append("UsedObjectCount:").Append(UsedObjectCount).Append('/').Append(TotalObjectCount).Append('\n') + .Append("TotalObjectCount").Append('/').Append("MaxSpawnCount:").Append(MaxSpawnCount.HasValue ? MaxSpawnCount.Value.ToString() : "-").Append('\n'); + + return stringBuilder.ToString(); +#else + return string.Empty; +#endif + } + } +} \ No newline at end of file diff --git a/Assets/Unity-Tools/Core/EasyPool/Core/RecyclablePoolInfo.cs.meta b/Assets/Unity-Tools/Core/EasyPool/Core/RecyclablePoolInfo.cs.meta new file mode 100644 index 0000000..d716bbe --- /dev/null +++ b/Assets/Unity-Tools/Core/EasyPool/Core/RecyclablePoolInfo.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 3de3c660f50a47e8bc523edfadb526c3 +timeCreated: 1735829404 \ No newline at end of file diff --git a/Assets/Unity-Tools/Core/EasyPool/Core/RecycleObjectType.cs b/Assets/Unity-Tools/Core/EasyPool/Core/RecycleObjectType.cs new file mode 100644 index 0000000..60d4b44 --- /dev/null +++ b/Assets/Unity-Tools/Core/EasyPool/Core/RecycleObjectType.cs @@ -0,0 +1,9 @@ +namespace Tools.EasyPoolKit +{ + public enum RecycleObjectType + { + Object, + RecyclableGameObject, + GameObject, + } +} \ No newline at end of file diff --git a/Assets/Unity-Tools/Core/EasyPool/Core/RecycleObjectType.cs.meta b/Assets/Unity-Tools/Core/EasyPool/Core/RecycleObjectType.cs.meta new file mode 100644 index 0000000..ed24844 --- /dev/null +++ b/Assets/Unity-Tools/Core/EasyPool/Core/RecycleObjectType.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 2a088bae858a4f58a733fc0ac9ef0594 +timeCreated: 1735826482 \ No newline at end of file diff --git a/Assets/Unity-Tools/Core/EasyPool/SimpleGOPool.meta b/Assets/Unity-Tools/Core/EasyPool/SimpleGOPool.meta new file mode 100644 index 0000000..c11939c --- /dev/null +++ b/Assets/Unity-Tools/Core/EasyPool/SimpleGOPool.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 84918e1e29eb44b08f12e0c4860711d6 +timeCreated: 1735828525 \ No newline at end of file diff --git a/Assets/Unity-Tools/Core/EasyPool/SimpleGOPool/SimpleGameObjectPool.cs b/Assets/Unity-Tools/Core/EasyPool/SimpleGOPool/SimpleGameObjectPool.cs new file mode 100644 index 0000000..dd37483 --- /dev/null +++ b/Assets/Unity-Tools/Core/EasyPool/SimpleGOPool/SimpleGameObjectPool.cs @@ -0,0 +1,400 @@ +using System; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Assertions; + +namespace Tools.EasyPoolKit +{ + public class SimpleGameObjectPool : ISimpleGameObjectPool + { + private Transform _cachedRoot; // 影藏位置 + protected Queue CachedQueue { get; private set; } // 影藏队列 + protected LinkedList UsedList { get; private set; } + protected Dictionary UsedTimeDic { get; private set; } + private int _objectCounter = 0; + private bool _ifInit = false; + + public RecycleObjectType ObjectType => RecycleObjectType.GameObject; + public Type ReferenceType { get; private set; } + public string PoolId { get; private set; } + public int? InitCreateCount { get; private set; } + public int? MaxSpawnCount { get; private set; } + public int? MaxDespawnCount { get; private set; } + public float? AutoClearTime { get; private set; } + public Func SpawnFunc { get; set; } + public PoolReachMaxLimitType ReachMaxLimitType { get; private set; } + public PoolDespawnDestroyType DespawnDestroyType { get; private set; } + public PoolClearType ClearType { get; private set; } + public bool IfIgnoreTimeScale { get; private set; } + + public int GetCachedObjectCount() => CachedQueue.Count; + public int GetUsedObjectCount() => UsedList.Count; + public int GetTotalObjectCount() => CachedQueue.Count + UsedList.Count; + + protected RecyclablePoolInfo PoolInfo; + + public SimpleGameObjectPool(RecyclablePoolConfig config) + { + InitByConfig(config); + } + + protected RecyclablePoolInfo InitByConfig(RecyclablePoolConfig config) + { + Assert.IsTrue(!_ifInit); + Assert.IsNotNull(config); + Assert.IsNotNull(config.SpawnFunc); + Assert.IsTrue(config.ObjectType == RecycleObjectType.GameObject); + + ReferenceType = config.ReferenceType; + PoolId = config.PoolId; + SpawnFunc = config.SpawnFunc; + ReachMaxLimitType = config.ReachMaxLimitType; + DespawnDestroyType = config.DespawnDestroyType; + ClearType = config.ClearType; + InitCreateCount = config.InitCreateCount; + MaxSpawnCount = config.MaxSpawnCount; + MaxDespawnCount = config.MaxDespawnCount; + AutoClearTime = config.AutoClearTime; + IfIgnoreTimeScale = config.IfIgnoreTimeScale; + + PoolInfo = new RecyclablePoolInfo(config, GetCachedObjectCount, GetUsedObjectCount, GetTotalObjectCount, this); + + CachedQueue = MaxSpawnCount.HasValue + ? new Queue(MaxSpawnCount.Value + 1) + : new Queue(); + UsedList = new LinkedList(); + UsedTimeDic = new Dictionary(); + + OnInitByParams(config.ExtraArgs); + InitCachedPool(); + _ifInit = true; + +#if EASY_POOL_DEBUG + Debug.Log($"EasyPoolKit == Create:Root:\n{GetDebugConfigInfo()}"); + + // 检测配置是否合法 + if (ReachMaxLimitType is PoolReachMaxLimitType.RecycleOldest or PoolReachMaxLimitType.RecycleOldest) + { + Assert.IsTrue(MaxSpawnCount is > 0); + } + + if (DespawnDestroyType is PoolDespawnDestroyType.DestroyToLimit) + { + Assert.IsTrue(MaxDespawnCount is > 0); + } + + if (MaxDespawnCount.HasValue && MaxSpawnCount.HasValue) + { + Assert.IsTrue(MaxDespawnCount.Value <= MaxSpawnCount.Value); + } + + if (InitCreateCount.HasValue && MaxSpawnCount.HasValue) + { + Assert.IsTrue(InitCreateCount.Value <= MaxSpawnCount.Value); + } +#endif + return PoolInfo; + } + + protected virtual void OnInitByParams(object[] args) + { + var extraArgs = args; + + if (extraArgs != null && extraArgs.Length > 0 && extraArgs[0] is Transform root) + { + _cachedRoot = root; + } + else + { + Debug.LogError("EasyPoolKit == 创建Mono物体时,extraArgs[0]应该输入Transform当做父节点"); + } + } + + private void InitCachedPool() + { + if (!InitCreateCount.HasValue) + { + return; + } + + var initCount = InitCreateCount.Value; + + for (int i = 0; i < initCount; i++) + { + var cachedObj = CreateObject(); + CachedQueue.Enqueue(cachedObj); + OnObjectEnqueue(cachedObj); + } + } + + protected virtual void OnObjectInit(GameObject usedObj){ } + protected virtual void OnObjectEnqueue(GameObject usedObj) => usedObj.transform.SetParent(_cachedRoot, true); + protected virtual void OnObjectDequeue(GameObject usedObj) => usedObj.transform.SetParent(null, true); + protected virtual void OnObjectDeInit(GameObject usedObj) + { + if (usedObj) + { + UnityEngine.Object.Destroy(usedObj); + } + } + + + // 内部方法,快速创建对象,不做繁琐的检查 + private GameObject CreateObject() + { + _objectCounter++; + var cachedObj = SpawnFunc?.Invoke() as GameObject; + + if (cachedObj) + { +#if EASY_POOL_DEBUG + cachedObj.name = $"{PoolId}_{_objectCounter}"; +#endif + OnObjectInit(cachedObj); + } +#if EASY_POOL_DEBUG + else + { + Debug.LogError($"EasyPoolKit == GenerateObject {PoolId} 创建的物体不该为空!"); + } +#endif + + return cachedObj; + } + + + public GameObject SpawnObject() + { + GameObject cachedObj = null; + + if (GetCachedObjectCount() > 0) + { + cachedObj = CachedQueue.Dequeue(); + } + else + { + bool ifReachLimit = false; + + if (ReachMaxLimitType != PoolReachMaxLimitType.Default && MaxSpawnCount.HasValue) + { + ifReachLimit = GetTotalObjectCount() >= MaxSpawnCount.Value; + } + + if (!ifReachLimit) + { + cachedObj = CreateObject(); + } + else + { + switch (ReachMaxLimitType) + { + case PoolReachMaxLimitType.RecycleOldest: + cachedObj = RecycleOldestObject(); + break; + case PoolReachMaxLimitType.Default: + // 不可达到 + case PoolReachMaxLimitType.RejectNull: + default: + // 什么都不做 + break; + } + } + } + + if (cachedObj != null) + { + OnObjectEnqueue(cachedObj); + UsedList.AddLast(cachedObj); + UsedTimeDic[cachedObj.GetInstanceID()] = 0; + } + + return cachedObj; + + GameObject RecycleOldestObject() + { +#if EASY_POOL_DEBUG + Assert.IsTrue(GetUsedObjectCount() > 0, $"EasyPoolKit == RecycleOldestObject {PoolId} 回收最老的物体时 UsedCount should > 0"); +#endif + var firstNode = UsedList.First; + UsedList.Remove(firstNode); + var oldestObj = firstNode.Value; + +#if EASY_POOL_DEBUG + if (!oldestObj) + { + Debug.LogError($"EasyPoolKit == RecycleOldestObject {PoolId} 回收最老的物体时 OldestObj should not be null"); + } +#endif + + // 直接将该物体作为新物体使用,不添加到CachedQueue,也不执行OnObjectEnqueue + return oldestObj; + } + } + + public bool TrySpawnObject(out GameObject newObj) + { + newObj = SpawnObject(); + return newObj != null; + } + + public bool DespawnObject(GameObject usedObj) + { +#if EASY_POOL_DEBUG + if (usedObj == null) + { + Debug.LogError("EasyPoolKit == 回收的物体不能为空"); + return false; + } +#endif + var usedNode = UsedList.Find(usedObj); + if (usedNode == null) + { + Debug.LogError($"EasyPoolKit == 无法回收该物体,该物体并不在使用物体队列中:{usedObj.name}"); + } + + bool ifReachLimit = false; + + if (DespawnDestroyType == PoolDespawnDestroyType.DestroyToLimit) + { + // if (MaxDespawnCount.HasValue && GetCachedObjectCount() > MaxDespawnCount.Value) + if (MaxDespawnCount.HasValue && GetCachedObjectCount() > MaxDespawnCount.Value) + { + ifReachLimit = true; + } + } + + UsedList.Remove(usedNode); + UsedTimeDic.Remove(usedObj.GetInstanceID()); + + if (ifReachLimit) + { + DestroyPoolObject(usedObj); + } + else + { + CachedQueue.Enqueue(usedObj); + OnObjectEnqueue(usedObj); + } + + return true; + } + + public void ClearUnusedObjects() + { + foreach (var cachedItem in CachedQueue) + { + DestroyPoolObject(cachedItem); + } + CachedQueue.Clear(); + } + + public void ClearAll() + { + switch (ClearType) + { + case PoolClearType.Default: + PoolClearAll(); + break; + case PoolClearType.ClearToLimit: + PoolClearToLimit(); + break; + } + } + + public void OnPoolUpdate(float deltaTime) + { + if (UsedList.Count > 0) + { + var node = UsedList.First; + float collectTime = AutoClearTime ?? -1f; + while (node != null) + { + var currentNode = node; + node = node.Next; + var usedObj = currentNode.Value; + + var objId = usedObj.GetInstanceID(); + + var usedTime = UsedTimeDic[objId]; + UsedTimeDic[objId] = usedTime + deltaTime; + + if (collectTime > 0 && usedTime >= collectTime) + { + DespawnObject(usedObj); + } + } + } + } + + public RecyclablePoolInfo GetPoolInfoReadOnly() => PoolInfo; + + private void DestroyPoolObject(GameObject poolObj) + { + if (poolObj) + { + OnObjectDeInit(poolObj); + } + } + + private void PoolClearAll() + { + ClearUnusedObjects(); + + while (UsedList.Count > 0) + { + var firstNode = UsedList.First; + var firstObj = firstNode.Value; + UsedList.Remove(firstNode); + DestroyPoolObject(firstObj); + } + + UsedList.Clear(); + } + + private void PoolClearToLimit() + { + if (!InitCreateCount.HasValue) + { + PoolClearAll(); + return; + } + + PoolClearRetain(); + + int removeCount = GetCachedObjectCount() - InitCreateCount.Value; + + while (removeCount > 0) + { + removeCount--; + var cachedObj = CachedQueue.Dequeue(); + DestroyPoolObject(cachedObj); + } + } + + /// 回收正在使用的物体 + private void PoolClearRetain() + { + while (UsedList.Count > 0) + { + var firstNode = UsedList.First; + var firstObj = firstNode.Value; + DespawnObject(firstObj); + } + } + + + #region Debug + + public string GetDebugConfigInfo() + { + return PoolInfo?.GetDebugConfigInfo() ?? string.Empty; + } + + public string GetDebugRunningInfo() + { + return PoolInfo?.GetDebugRunningInfo() ?? string.Empty; + } + + #endregion + } +} \ No newline at end of file diff --git a/Assets/Unity-Tools/Core/EasyPool/SimpleGOPool/SimpleGameObjectPool.cs.meta b/Assets/Unity-Tools/Core/EasyPool/SimpleGOPool/SimpleGameObjectPool.cs.meta new file mode 100644 index 0000000..fa05460 --- /dev/null +++ b/Assets/Unity-Tools/Core/EasyPool/SimpleGOPool/SimpleGameObjectPool.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 4157f7b19be94bedaf91bfe7ee06a69e +timeCreated: 1735828587 \ No newline at end of file diff --git a/Assets/Unity-Tools/Samples.meta b/Assets/Unity-Tools/Demo.meta similarity index 100% rename from Assets/Unity-Tools/Samples.meta rename to Assets/Unity-Tools/Demo.meta diff --git a/Assets/Unity-Tools/Samples/Attributes.meta b/Assets/Unity-Tools/Demo/Attributes.meta similarity index 100% rename from Assets/Unity-Tools/Samples/Attributes.meta rename to Assets/Unity-Tools/Demo/Attributes.meta diff --git a/Assets/Unity-Tools/Samples/Attributes/ApplyToDictionary.cs b/Assets/Unity-Tools/Demo/Attributes/ApplyToDictionary.cs similarity index 100% rename from Assets/Unity-Tools/Samples/Attributes/ApplyToDictionary.cs rename to Assets/Unity-Tools/Demo/Attributes/ApplyToDictionary.cs diff --git a/Assets/Unity-Tools/Samples/Attributes/ApplyToDictionary.cs.meta b/Assets/Unity-Tools/Demo/Attributes/ApplyToDictionary.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/Attributes/ApplyToDictionary.cs.meta rename to Assets/Unity-Tools/Demo/Attributes/ApplyToDictionary.cs.meta diff --git a/Assets/Unity-Tools/Demo/EasyPoolKit.meta b/Assets/Unity-Tools/Demo/EasyPoolKit.meta new file mode 100644 index 0000000..75f78b3 --- /dev/null +++ b/Assets/Unity-Tools/Demo/EasyPoolKit.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 42040b2b14ed8dd408545a2e51c478f8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Unity-Tools/Demo/EasyPoolKit/SimpleGOPool.meta b/Assets/Unity-Tools/Demo/EasyPoolKit/SimpleGOPool.meta new file mode 100644 index 0000000..66f04d9 --- /dev/null +++ b/Assets/Unity-Tools/Demo/EasyPoolKit/SimpleGOPool.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d5b1a5bf68769254180b013c85e55147 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Unity-Tools/Demo/EasyPoolKit/SimpleGOPool/SimpleGOPool.unity b/Assets/Unity-Tools/Demo/EasyPoolKit/SimpleGOPool/SimpleGOPool.unity new file mode 100644 index 0000000..c277d9b --- /dev/null +++ b/Assets/Unity-Tools/Demo/EasyPoolKit/SimpleGOPool/SimpleGOPool.unity @@ -0,0 +1,495 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 10 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 13 + m_BakeOnSceneLoad: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 1 + m_PVRFilteringGaussRadiusAO: 1 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &65465572 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 65465575} + - component: {fileID: 65465574} + - component: {fileID: 65465573} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &65465573 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 65465572} + m_Enabled: 1 +--- !u!20 &65465574 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 65465572} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &65465575 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 65465572} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &79651670 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 79651672} + - component: {fileID: 79651671} + - component: {fileID: 79651673} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &79651671 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 79651670} + m_Enabled: 1 + serializedVersion: 11 + m_Type: 1 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ForceVisible: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 + m_LightUnit: 1 + m_LuxAtDistance: 1 + m_EnableSpotReflector: 1 +--- !u!4 &79651672 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 79651670} + serializedVersion: 2 + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!114 &79651673 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 79651670} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Version: 3 + m_UsePipelineSettings: 1 + m_AdditionalLightsShadowResolutionTier: 2 + m_LightLayerMask: 1 + m_RenderingLayers: 1 + m_CustomShadowLayers: 0 + m_ShadowLayerMask: 1 + m_ShadowRenderingLayers: 1 + m_LightCookieSize: {x: 1, y: 1} + m_LightCookieOffset: {x: 0, y: 0} + m_SoftShadowQuality: 0 +--- !u!1 &1887936863 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1887936864} + - component: {fileID: 1887936865} + m_Layer: 0 + m_Name: Manager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1887936864 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1887936863} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1887936865 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1887936863} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c53679ae49565704d8a17892b9bbc378, type: 3} + m_Name: + m_EditorClassIdentifier: + prefab: {fileID: 2037916656} +--- !u!1 &2037916656 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2037916660} + - component: {fileID: 2037916659} + - component: {fileID: 2037916658} + - component: {fileID: 2037916657} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!65 &2037916657 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2037916656} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &2037916658 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2037916656} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RayTracingAccelStructBuildFlagsOverride: 0 + m_RayTracingAccelStructBuildFlags: 1 + m_SmallMeshCulling: 1 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &2037916659 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2037916656} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &2037916660 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2037916656} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 2.084, z: 2.399} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 65465575} + - {fileID: 79651672} + - {fileID: 1887936864} + - {fileID: 2037916660} diff --git a/Assets/Unity-Tools/Demo/EasyPoolKit/SimpleGOPool/SimpleGOPool.unity.meta b/Assets/Unity-Tools/Demo/EasyPoolKit/SimpleGOPool/SimpleGOPool.unity.meta new file mode 100644 index 0000000..7155fa4 --- /dev/null +++ b/Assets/Unity-Tools/Demo/EasyPoolKit/SimpleGOPool/SimpleGOPool.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5db3399e186fb594b94c0b7480d102a3 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Unity-Tools/Demo/EasyPoolKit/SimpleGOPool/SimpleGOPoolManager.cs b/Assets/Unity-Tools/Demo/EasyPoolKit/SimpleGOPool/SimpleGOPoolManager.cs new file mode 100644 index 0000000..640ebfb --- /dev/null +++ b/Assets/Unity-Tools/Demo/EasyPoolKit/SimpleGOPool/SimpleGOPoolManager.cs @@ -0,0 +1,18 @@ +using UnityEngine; + +namespace Tools.EasyPoolKit.Demo +{ + public class SimpleGOPoolManager : MonoBehaviour + { + public GameObject prefab; + private void Start() + { + var config = new RecyclablePoolConfig(); + config.SpawnFunc = () => Instantiate(prefab); + config.ObjectType = RecycleObjectType.GameObject; + config.ExtraArgs = new object[] { transform }; + config.InitCreateCount = 5; + var pool = new SimpleGameObjectPool(config); + } + } +} diff --git a/Assets/Unity-Tools/Demo/EasyPoolKit/SimpleGOPool/SimpleGOPoolManager.cs.meta b/Assets/Unity-Tools/Demo/EasyPoolKit/SimpleGOPool/SimpleGOPoolManager.cs.meta new file mode 100644 index 0000000..73f5d53 --- /dev/null +++ b/Assets/Unity-Tools/Demo/EasyPoolKit/SimpleGOPool/SimpleGOPoolManager.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c53679ae49565704d8a17892b9bbc378 \ No newline at end of file diff --git a/Assets/Unity-Tools/Samples/EventBus.meta b/Assets/Unity-Tools/Demo/EventBus.meta similarity index 100% rename from Assets/Unity-Tools/Samples/EventBus.meta rename to Assets/Unity-Tools/Demo/EventBus.meta diff --git a/Assets/Unity-Tools/Samples/EventBus/EventBus.unity b/Assets/Unity-Tools/Demo/EventBus/EventBus.unity similarity index 100% rename from Assets/Unity-Tools/Samples/EventBus/EventBus.unity rename to Assets/Unity-Tools/Demo/EventBus/EventBus.unity diff --git a/Assets/Unity-Tools/Samples/EventBus/EventBus.unity.meta b/Assets/Unity-Tools/Demo/EventBus/EventBus.unity.meta similarity index 100% rename from Assets/Unity-Tools/Samples/EventBus/EventBus.unity.meta rename to Assets/Unity-Tools/Demo/EventBus/EventBus.unity.meta diff --git a/Assets/Unity-Tools/Samples/EventBus/Listener.cs b/Assets/Unity-Tools/Demo/EventBus/Listener.cs similarity index 100% rename from Assets/Unity-Tools/Samples/EventBus/Listener.cs rename to Assets/Unity-Tools/Demo/EventBus/Listener.cs diff --git a/Assets/Unity-Tools/Samples/EventBus/Listener.cs.meta b/Assets/Unity-Tools/Demo/EventBus/Listener.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/EventBus/Listener.cs.meta rename to Assets/Unity-Tools/Demo/EventBus/Listener.cs.meta diff --git a/Assets/Unity-Tools/Samples/EventBus/Trigger.cs b/Assets/Unity-Tools/Demo/EventBus/Trigger.cs similarity index 100% rename from Assets/Unity-Tools/Samples/EventBus/Trigger.cs rename to Assets/Unity-Tools/Demo/EventBus/Trigger.cs diff --git a/Assets/Unity-Tools/Samples/EventBus/Trigger.cs.meta b/Assets/Unity-Tools/Demo/EventBus/Trigger.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/EventBus/Trigger.cs.meta rename to Assets/Unity-Tools/Demo/EventBus/Trigger.cs.meta diff --git a/Assets/Unity-Tools/Samples/FSM.meta b/Assets/Unity-Tools/Demo/FSM.meta similarity index 100% rename from Assets/Unity-Tools/Samples/FSM.meta rename to Assets/Unity-Tools/Demo/FSM.meta diff --git a/Assets/Unity-Tools/Samples/FSM/AttackState.cs b/Assets/Unity-Tools/Demo/FSM/AttackState.cs similarity index 100% rename from Assets/Unity-Tools/Samples/FSM/AttackState.cs rename to Assets/Unity-Tools/Demo/FSM/AttackState.cs diff --git a/Assets/Unity-Tools/Samples/FSM/AttackState.cs.meta b/Assets/Unity-Tools/Demo/FSM/AttackState.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/FSM/AttackState.cs.meta rename to Assets/Unity-Tools/Demo/FSM/AttackState.cs.meta diff --git a/Assets/Unity-Tools/Samples/FSM/AttackState2.cs b/Assets/Unity-Tools/Demo/FSM/AttackState2.cs similarity index 100% rename from Assets/Unity-Tools/Samples/FSM/AttackState2.cs rename to Assets/Unity-Tools/Demo/FSM/AttackState2.cs diff --git a/Assets/Unity-Tools/Samples/FSM/AttackState2.cs.meta b/Assets/Unity-Tools/Demo/FSM/AttackState2.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/FSM/AttackState2.cs.meta rename to Assets/Unity-Tools/Demo/FSM/AttackState2.cs.meta diff --git a/Assets/Unity-Tools/Samples/FSM/FSM.unity b/Assets/Unity-Tools/Demo/FSM/FSM.unity similarity index 100% rename from Assets/Unity-Tools/Samples/FSM/FSM.unity rename to Assets/Unity-Tools/Demo/FSM/FSM.unity diff --git a/Assets/Unity-Tools/Samples/FSM/FSM.unity.meta b/Assets/Unity-Tools/Demo/FSM/FSM.unity.meta similarity index 100% rename from Assets/Unity-Tools/Samples/FSM/FSM.unity.meta rename to Assets/Unity-Tools/Demo/FSM/FSM.unity.meta diff --git a/Assets/Unity-Tools/Samples/FSM/IdleState.cs b/Assets/Unity-Tools/Demo/FSM/IdleState.cs similarity index 100% rename from Assets/Unity-Tools/Samples/FSM/IdleState.cs rename to Assets/Unity-Tools/Demo/FSM/IdleState.cs diff --git a/Assets/Unity-Tools/Samples/FSM/IdleState.cs.meta b/Assets/Unity-Tools/Demo/FSM/IdleState.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/FSM/IdleState.cs.meta rename to Assets/Unity-Tools/Demo/FSM/IdleState.cs.meta diff --git a/Assets/Unity-Tools/Samples/FSM/MoveState.cs b/Assets/Unity-Tools/Demo/FSM/MoveState.cs similarity index 100% rename from Assets/Unity-Tools/Samples/FSM/MoveState.cs rename to Assets/Unity-Tools/Demo/FSM/MoveState.cs diff --git a/Assets/Unity-Tools/Samples/FSM/MoveState.cs.meta b/Assets/Unity-Tools/Demo/FSM/MoveState.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/FSM/MoveState.cs.meta rename to Assets/Unity-Tools/Demo/FSM/MoveState.cs.meta diff --git a/Assets/Unity-Tools/Samples/FSM/PlayerBrain1.cs b/Assets/Unity-Tools/Demo/FSM/PlayerBrain1.cs similarity index 100% rename from Assets/Unity-Tools/Samples/FSM/PlayerBrain1.cs rename to Assets/Unity-Tools/Demo/FSM/PlayerBrain1.cs diff --git a/Assets/Unity-Tools/Samples/FSM/PlayerBrain1.cs.meta b/Assets/Unity-Tools/Demo/FSM/PlayerBrain1.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/FSM/PlayerBrain1.cs.meta rename to Assets/Unity-Tools/Demo/FSM/PlayerBrain1.cs.meta diff --git a/Assets/Unity-Tools/Samples/FSM/PlayerBrain1.prefab b/Assets/Unity-Tools/Demo/FSM/PlayerBrain1.prefab similarity index 100% rename from Assets/Unity-Tools/Samples/FSM/PlayerBrain1.prefab rename to Assets/Unity-Tools/Demo/FSM/PlayerBrain1.prefab diff --git a/Assets/Unity-Tools/Samples/FSM/PlayerBrain1.prefab.meta b/Assets/Unity-Tools/Demo/FSM/PlayerBrain1.prefab.meta similarity index 100% rename from Assets/Unity-Tools/Samples/FSM/PlayerBrain1.prefab.meta rename to Assets/Unity-Tools/Demo/FSM/PlayerBrain1.prefab.meta diff --git a/Assets/Unity-Tools/Samples/FSM/PlayerBrain2.cs b/Assets/Unity-Tools/Demo/FSM/PlayerBrain2.cs similarity index 100% rename from Assets/Unity-Tools/Samples/FSM/PlayerBrain2.cs rename to Assets/Unity-Tools/Demo/FSM/PlayerBrain2.cs diff --git a/Assets/Unity-Tools/Samples/FSM/PlayerBrain2.cs.meta b/Assets/Unity-Tools/Demo/FSM/PlayerBrain2.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/FSM/PlayerBrain2.cs.meta rename to Assets/Unity-Tools/Demo/FSM/PlayerBrain2.cs.meta diff --git a/Assets/Unity-Tools/Samples/FSM/PlayerBrain2.prefab b/Assets/Unity-Tools/Demo/FSM/PlayerBrain2.prefab similarity index 100% rename from Assets/Unity-Tools/Samples/FSM/PlayerBrain2.prefab rename to Assets/Unity-Tools/Demo/FSM/PlayerBrain2.prefab diff --git a/Assets/Unity-Tools/Samples/FSM/PlayerBrain2.prefab.meta b/Assets/Unity-Tools/Demo/FSM/PlayerBrain2.prefab.meta similarity index 100% rename from Assets/Unity-Tools/Samples/FSM/PlayerBrain2.prefab.meta rename to Assets/Unity-Tools/Demo/FSM/PlayerBrain2.prefab.meta diff --git a/Assets/Unity-Tools/Samples/InterfaceReference.meta b/Assets/Unity-Tools/Demo/InterfaceReference.meta similarity index 100% rename from Assets/Unity-Tools/Samples/InterfaceReference.meta rename to Assets/Unity-Tools/Demo/InterfaceReference.meta diff --git a/Assets/Unity-Tools/Samples/InterfaceReference/DamageableAsset.asset b/Assets/Unity-Tools/Demo/InterfaceReference/DamageableAsset.asset similarity index 100% rename from Assets/Unity-Tools/Samples/InterfaceReference/DamageableAsset.asset rename to Assets/Unity-Tools/Demo/InterfaceReference/DamageableAsset.asset diff --git a/Assets/Unity-Tools/Samples/InterfaceReference/DamageableAsset.asset.meta b/Assets/Unity-Tools/Demo/InterfaceReference/DamageableAsset.asset.meta similarity index 100% rename from Assets/Unity-Tools/Samples/InterfaceReference/DamageableAsset.asset.meta rename to Assets/Unity-Tools/Demo/InterfaceReference/DamageableAsset.asset.meta diff --git a/Assets/Unity-Tools/Samples/InterfaceReference/DamageableAsset.cs b/Assets/Unity-Tools/Demo/InterfaceReference/DamageableAsset.cs similarity index 100% rename from Assets/Unity-Tools/Samples/InterfaceReference/DamageableAsset.cs rename to Assets/Unity-Tools/Demo/InterfaceReference/DamageableAsset.cs diff --git a/Assets/Unity-Tools/Samples/InterfaceReference/DamageableAsset.cs.meta b/Assets/Unity-Tools/Demo/InterfaceReference/DamageableAsset.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/InterfaceReference/DamageableAsset.cs.meta rename to Assets/Unity-Tools/Demo/InterfaceReference/DamageableAsset.cs.meta diff --git a/Assets/Unity-Tools/Samples/InterfaceReference/DamageableComponent.cs b/Assets/Unity-Tools/Demo/InterfaceReference/DamageableComponent.cs similarity index 100% rename from Assets/Unity-Tools/Samples/InterfaceReference/DamageableComponent.cs rename to Assets/Unity-Tools/Demo/InterfaceReference/DamageableComponent.cs diff --git a/Assets/Unity-Tools/Samples/InterfaceReference/DamageableComponent.cs.meta b/Assets/Unity-Tools/Demo/InterfaceReference/DamageableComponent.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/InterfaceReference/DamageableComponent.cs.meta rename to Assets/Unity-Tools/Demo/InterfaceReference/DamageableComponent.cs.meta diff --git a/Assets/Unity-Tools/Samples/InterfaceReference/Example.cs b/Assets/Unity-Tools/Demo/InterfaceReference/Example.cs similarity index 100% rename from Assets/Unity-Tools/Samples/InterfaceReference/Example.cs rename to Assets/Unity-Tools/Demo/InterfaceReference/Example.cs diff --git a/Assets/Unity-Tools/Samples/InterfaceReference/Example.cs.meta b/Assets/Unity-Tools/Demo/InterfaceReference/Example.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/InterfaceReference/Example.cs.meta rename to Assets/Unity-Tools/Demo/InterfaceReference/Example.cs.meta diff --git a/Assets/Unity-Tools/Samples/InterfaceReference/IDamageable.cs b/Assets/Unity-Tools/Demo/InterfaceReference/IDamageable.cs similarity index 100% rename from Assets/Unity-Tools/Samples/InterfaceReference/IDamageable.cs rename to Assets/Unity-Tools/Demo/InterfaceReference/IDamageable.cs diff --git a/Assets/Unity-Tools/Samples/InterfaceReference/IDamageable.cs.meta b/Assets/Unity-Tools/Demo/InterfaceReference/IDamageable.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/InterfaceReference/IDamageable.cs.meta rename to Assets/Unity-Tools/Demo/InterfaceReference/IDamageable.cs.meta diff --git a/Assets/Unity-Tools/Samples/InterfaceReference/InterfaceReference.unity b/Assets/Unity-Tools/Demo/InterfaceReference/InterfaceReference.unity similarity index 100% rename from Assets/Unity-Tools/Samples/InterfaceReference/InterfaceReference.unity rename to Assets/Unity-Tools/Demo/InterfaceReference/InterfaceReference.unity diff --git a/Assets/Unity-Tools/Samples/InterfaceReference/InterfaceReference.unity.meta b/Assets/Unity-Tools/Demo/InterfaceReference/InterfaceReference.unity.meta similarity index 100% rename from Assets/Unity-Tools/Samples/InterfaceReference/InterfaceReference.unity.meta rename to Assets/Unity-Tools/Demo/InterfaceReference/InterfaceReference.unity.meta diff --git a/Assets/Unity-Tools/Samples/InterfaceReference/OdinExample.cs b/Assets/Unity-Tools/Demo/InterfaceReference/OdinExample.cs similarity index 100% rename from Assets/Unity-Tools/Samples/InterfaceReference/OdinExample.cs rename to Assets/Unity-Tools/Demo/InterfaceReference/OdinExample.cs diff --git a/Assets/Unity-Tools/Samples/InterfaceReference/OdinExample.cs.meta b/Assets/Unity-Tools/Demo/InterfaceReference/OdinExample.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/InterfaceReference/OdinExample.cs.meta rename to Assets/Unity-Tools/Demo/InterfaceReference/OdinExample.cs.meta diff --git a/Assets/Unity-Tools/Samples/Inventory.meta b/Assets/Unity-Tools/Demo/Inventory.meta similarity index 100% rename from Assets/Unity-Tools/Samples/Inventory.meta rename to Assets/Unity-Tools/Demo/Inventory.meta diff --git a/Assets/Unity-Tools/Samples/Inventory/Icon.meta b/Assets/Unity-Tools/Demo/Inventory/Icon.meta similarity index 100% rename from Assets/Unity-Tools/Samples/Inventory/Icon.meta rename to Assets/Unity-Tools/Demo/Inventory/Icon.meta diff --git a/Assets/Unity-Tools/Samples/Inventory/Icon/Pen.png b/Assets/Unity-Tools/Demo/Inventory/Icon/Pen.png similarity index 100% rename from Assets/Unity-Tools/Samples/Inventory/Icon/Pen.png rename to Assets/Unity-Tools/Demo/Inventory/Icon/Pen.png diff --git a/Assets/Unity-Tools/Samples/Inventory/Icon/Pen.png.meta b/Assets/Unity-Tools/Demo/Inventory/Icon/Pen.png.meta similarity index 100% rename from Assets/Unity-Tools/Samples/Inventory/Icon/Pen.png.meta rename to Assets/Unity-Tools/Demo/Inventory/Icon/Pen.png.meta diff --git a/Assets/Unity-Tools/Samples/Inventory/Icon/Stamps.png b/Assets/Unity-Tools/Demo/Inventory/Icon/Stamps.png similarity index 100% rename from Assets/Unity-Tools/Samples/Inventory/Icon/Stamps.png rename to Assets/Unity-Tools/Demo/Inventory/Icon/Stamps.png diff --git a/Assets/Unity-Tools/Samples/Inventory/Icon/Stamps.png.meta b/Assets/Unity-Tools/Demo/Inventory/Icon/Stamps.png.meta similarity index 100% rename from Assets/Unity-Tools/Samples/Inventory/Icon/Stamps.png.meta rename to Assets/Unity-Tools/Demo/Inventory/Icon/Stamps.png.meta diff --git a/Assets/Unity-Tools/Samples/Inventory/IconGenerator.unity b/Assets/Unity-Tools/Demo/Inventory/IconGenerator.unity similarity index 100% rename from Assets/Unity-Tools/Samples/Inventory/IconGenerator.unity rename to Assets/Unity-Tools/Demo/Inventory/IconGenerator.unity diff --git a/Assets/Unity-Tools/Samples/Inventory/IconGenerator.unity.meta b/Assets/Unity-Tools/Demo/Inventory/IconGenerator.unity.meta similarity index 100% rename from Assets/Unity-Tools/Samples/Inventory/IconGenerator.unity.meta rename to Assets/Unity-Tools/Demo/Inventory/IconGenerator.unity.meta diff --git a/Assets/Unity-Tools/Samples/Inventory/Inventory.unity b/Assets/Unity-Tools/Demo/Inventory/Inventory.unity similarity index 100% rename from Assets/Unity-Tools/Samples/Inventory/Inventory.unity rename to Assets/Unity-Tools/Demo/Inventory/Inventory.unity diff --git a/Assets/Unity-Tools/Samples/Inventory/Inventory.unity.meta b/Assets/Unity-Tools/Demo/Inventory/Inventory.unity.meta similarity index 100% rename from Assets/Unity-Tools/Samples/Inventory/Inventory.unity.meta rename to Assets/Unity-Tools/Demo/Inventory/Inventory.unity.meta diff --git a/Assets/Unity-Tools/Samples/Inventory/Pen.prefab b/Assets/Unity-Tools/Demo/Inventory/Pen.prefab similarity index 100% rename from Assets/Unity-Tools/Samples/Inventory/Pen.prefab rename to Assets/Unity-Tools/Demo/Inventory/Pen.prefab diff --git a/Assets/Unity-Tools/Samples/Inventory/Pen.prefab.meta b/Assets/Unity-Tools/Demo/Inventory/Pen.prefab.meta similarity index 100% rename from Assets/Unity-Tools/Samples/Inventory/Pen.prefab.meta rename to Assets/Unity-Tools/Demo/Inventory/Pen.prefab.meta diff --git a/Assets/Unity-Tools/Samples/Inventory/Stamps.asset b/Assets/Unity-Tools/Demo/Inventory/Stamps.asset similarity index 100% rename from Assets/Unity-Tools/Samples/Inventory/Stamps.asset rename to Assets/Unity-Tools/Demo/Inventory/Stamps.asset diff --git a/Assets/Unity-Tools/Samples/Inventory/Stamps.asset.meta b/Assets/Unity-Tools/Demo/Inventory/Stamps.asset.meta similarity index 100% rename from Assets/Unity-Tools/Samples/Inventory/Stamps.asset.meta rename to Assets/Unity-Tools/Demo/Inventory/Stamps.asset.meta diff --git a/Assets/Unity-Tools/Samples/Inventory/Stamps.prefab b/Assets/Unity-Tools/Demo/Inventory/Stamps.prefab similarity index 100% rename from Assets/Unity-Tools/Samples/Inventory/Stamps.prefab rename to Assets/Unity-Tools/Demo/Inventory/Stamps.prefab diff --git a/Assets/Unity-Tools/Samples/Inventory/Stamps.prefab.meta b/Assets/Unity-Tools/Demo/Inventory/Stamps.prefab.meta similarity index 100% rename from Assets/Unity-Tools/Samples/Inventory/Stamps.prefab.meta rename to Assets/Unity-Tools/Demo/Inventory/Stamps.prefab.meta diff --git a/Assets/Unity-Tools/Samples/Observable.meta b/Assets/Unity-Tools/Demo/Observable.meta similarity index 100% rename from Assets/Unity-Tools/Samples/Observable.meta rename to Assets/Unity-Tools/Demo/Observable.meta diff --git a/Assets/Unity-Tools/Samples/Observable/Manager.cs b/Assets/Unity-Tools/Demo/Observable/Manager.cs similarity index 100% rename from Assets/Unity-Tools/Samples/Observable/Manager.cs rename to Assets/Unity-Tools/Demo/Observable/Manager.cs diff --git a/Assets/Unity-Tools/Samples/Observable/Manager.cs.meta b/Assets/Unity-Tools/Demo/Observable/Manager.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/Observable/Manager.cs.meta rename to Assets/Unity-Tools/Demo/Observable/Manager.cs.meta diff --git a/Assets/Unity-Tools/Samples/Observable/Observable.unity b/Assets/Unity-Tools/Demo/Observable/Observable.unity similarity index 100% rename from Assets/Unity-Tools/Samples/Observable/Observable.unity rename to Assets/Unity-Tools/Demo/Observable/Observable.unity diff --git a/Assets/Unity-Tools/Samples/Observable/Observable.unity.meta b/Assets/Unity-Tools/Demo/Observable/Observable.unity.meta similarity index 100% rename from Assets/Unity-Tools/Samples/Observable/Observable.unity.meta rename to Assets/Unity-Tools/Demo/Observable/Observable.unity.meta diff --git a/Assets/Unity-Tools/Samples/Observable/Player.cs b/Assets/Unity-Tools/Demo/Observable/Player.cs similarity index 100% rename from Assets/Unity-Tools/Samples/Observable/Player.cs rename to Assets/Unity-Tools/Demo/Observable/Player.cs diff --git a/Assets/Unity-Tools/Samples/Observable/Player.cs.meta b/Assets/Unity-Tools/Demo/Observable/Player.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/Observable/Player.cs.meta rename to Assets/Unity-Tools/Demo/Observable/Player.cs.meta diff --git a/Assets/Unity-Tools/Samples/OdinDrawer.meta b/Assets/Unity-Tools/Demo/OdinDrawer.meta similarity index 100% rename from Assets/Unity-Tools/Samples/OdinDrawer.meta rename to Assets/Unity-Tools/Demo/OdinDrawer.meta diff --git a/Assets/Unity-Tools/Samples/OdinDrawer/OdinClass.cs b/Assets/Unity-Tools/Demo/OdinDrawer/OdinClass.cs similarity index 100% rename from Assets/Unity-Tools/Samples/OdinDrawer/OdinClass.cs rename to Assets/Unity-Tools/Demo/OdinDrawer/OdinClass.cs diff --git a/Assets/Unity-Tools/Samples/OdinDrawer/OdinClass.cs.meta b/Assets/Unity-Tools/Demo/OdinDrawer/OdinClass.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/OdinDrawer/OdinClass.cs.meta rename to Assets/Unity-Tools/Demo/OdinDrawer/OdinClass.cs.meta diff --git a/Assets/Unity-Tools/Samples/OdinDrawer/OdinDrawer.unity b/Assets/Unity-Tools/Demo/OdinDrawer/OdinDrawer.unity similarity index 100% rename from Assets/Unity-Tools/Samples/OdinDrawer/OdinDrawer.unity rename to Assets/Unity-Tools/Demo/OdinDrawer/OdinDrawer.unity diff --git a/Assets/Unity-Tools/Samples/OdinDrawer/OdinDrawer.unity.meta b/Assets/Unity-Tools/Demo/OdinDrawer/OdinDrawer.unity.meta similarity index 100% rename from Assets/Unity-Tools/Samples/OdinDrawer/OdinDrawer.unity.meta rename to Assets/Unity-Tools/Demo/OdinDrawer/OdinDrawer.unity.meta diff --git a/Assets/Unity-Tools/Samples/OdinDrawer/OdinStruct.cs b/Assets/Unity-Tools/Demo/OdinDrawer/OdinStruct.cs similarity index 100% rename from Assets/Unity-Tools/Samples/OdinDrawer/OdinStruct.cs rename to Assets/Unity-Tools/Demo/OdinDrawer/OdinStruct.cs diff --git a/Assets/Unity-Tools/Samples/OdinDrawer/OdinStruct.cs.meta b/Assets/Unity-Tools/Demo/OdinDrawer/OdinStruct.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/OdinDrawer/OdinStruct.cs.meta rename to Assets/Unity-Tools/Demo/OdinDrawer/OdinStruct.cs.meta diff --git a/Assets/Unity-Tools/Samples/OdinDrawer/Show.cs b/Assets/Unity-Tools/Demo/OdinDrawer/Show.cs similarity index 100% rename from Assets/Unity-Tools/Samples/OdinDrawer/Show.cs rename to Assets/Unity-Tools/Demo/OdinDrawer/Show.cs diff --git a/Assets/Unity-Tools/Samples/OdinDrawer/Show.cs.meta b/Assets/Unity-Tools/Demo/OdinDrawer/Show.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/OdinDrawer/Show.cs.meta rename to Assets/Unity-Tools/Demo/OdinDrawer/Show.cs.meta diff --git a/Assets/Unity-Tools/Samples/OdinDrawer/Test.cs b/Assets/Unity-Tools/Demo/OdinDrawer/Test.cs similarity index 100% rename from Assets/Unity-Tools/Samples/OdinDrawer/Test.cs rename to Assets/Unity-Tools/Demo/OdinDrawer/Test.cs diff --git a/Assets/Unity-Tools/Samples/OdinDrawer/Test.cs.meta b/Assets/Unity-Tools/Demo/OdinDrawer/Test.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/OdinDrawer/Test.cs.meta rename to Assets/Unity-Tools/Demo/OdinDrawer/Test.cs.meta diff --git a/Assets/Unity-Tools/Samples/PoolModule.meta b/Assets/Unity-Tools/Demo/PoolModule.meta similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule.meta rename to Assets/Unity-Tools/Demo/PoolModule.meta diff --git a/Assets/Unity-Tools/Samples/PoolModule/Item.cs b/Assets/Unity-Tools/Demo/PoolModule/Item.cs similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/Item.cs rename to Assets/Unity-Tools/Demo/PoolModule/Item.cs diff --git a/Assets/Unity-Tools/Samples/PoolModule/Item.cs.meta b/Assets/Unity-Tools/Demo/PoolModule/Item.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/Item.cs.meta rename to Assets/Unity-Tools/Demo/PoolModule/Item.cs.meta diff --git a/Assets/Unity-Tools/Samples/PoolModule/Item.prefab b/Assets/Unity-Tools/Demo/PoolModule/Item.prefab similarity index 99% rename from Assets/Unity-Tools/Samples/PoolModule/Item.prefab rename to Assets/Unity-Tools/Demo/PoolModule/Item.prefab index 4837a0d..6a38301 100644 --- a/Assets/Unity-Tools/Samples/PoolModule/Item.prefab +++ b/Assets/Unity-Tools/Demo/PoolModule/Item.prefab @@ -119,7 +119,7 @@ GameObject: - component: {fileID: 6326749341578172990} - component: {fileID: 7702397136114910295} m_Layer: 0 - m_Name: Item + m_Name: m m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 diff --git a/Assets/Unity-Tools/Samples/PoolModule/Item.prefab.meta b/Assets/Unity-Tools/Demo/PoolModule/Item.prefab.meta similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/Item.prefab.meta rename to Assets/Unity-Tools/Demo/PoolModule/Item.prefab.meta diff --git a/Assets/Unity-Tools/Samples/PoolModule/ItemA.cs b/Assets/Unity-Tools/Demo/PoolModule/ItemA.cs similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/ItemA.cs rename to Assets/Unity-Tools/Demo/PoolModule/ItemA.cs diff --git a/Assets/Unity-Tools/Samples/PoolModule/ItemA.cs.meta b/Assets/Unity-Tools/Demo/PoolModule/ItemA.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/ItemA.cs.meta rename to Assets/Unity-Tools/Demo/PoolModule/ItemA.cs.meta diff --git a/Assets/Unity-Tools/Samples/PoolModule/ItemA.prefab b/Assets/Unity-Tools/Demo/PoolModule/ItemA.prefab similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/ItemA.prefab rename to Assets/Unity-Tools/Demo/PoolModule/ItemA.prefab diff --git a/Assets/Unity-Tools/Samples/PoolModule/ItemA.prefab.meta b/Assets/Unity-Tools/Demo/PoolModule/ItemA.prefab.meta similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/ItemA.prefab.meta rename to Assets/Unity-Tools/Demo/PoolModule/ItemA.prefab.meta diff --git a/Assets/Unity-Tools/Samples/PoolModule/ItemB.cs b/Assets/Unity-Tools/Demo/PoolModule/ItemB.cs similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/ItemB.cs rename to Assets/Unity-Tools/Demo/PoolModule/ItemB.cs diff --git a/Assets/Unity-Tools/Samples/PoolModule/ItemB.cs.meta b/Assets/Unity-Tools/Demo/PoolModule/ItemB.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/ItemB.cs.meta rename to Assets/Unity-Tools/Demo/PoolModule/ItemB.cs.meta diff --git a/Assets/Unity-Tools/Samples/PoolModule/ItemB.prefab b/Assets/Unity-Tools/Demo/PoolModule/ItemB.prefab similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/ItemB.prefab rename to Assets/Unity-Tools/Demo/PoolModule/ItemB.prefab diff --git a/Assets/Unity-Tools/Samples/PoolModule/ItemB.prefab.meta b/Assets/Unity-Tools/Demo/PoolModule/ItemB.prefab.meta similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/ItemB.prefab.meta rename to Assets/Unity-Tools/Demo/PoolModule/ItemB.prefab.meta diff --git a/Assets/Unity-Tools/Samples/PoolModule/ItemFactory.cs b/Assets/Unity-Tools/Demo/PoolModule/ItemFactory.cs similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/ItemFactory.cs rename to Assets/Unity-Tools/Demo/PoolModule/ItemFactory.cs diff --git a/Assets/Unity-Tools/Samples/PoolModule/ItemFactory.cs.meta b/Assets/Unity-Tools/Demo/PoolModule/ItemFactory.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/ItemFactory.cs.meta rename to Assets/Unity-Tools/Demo/PoolModule/ItemFactory.cs.meta diff --git a/Assets/Unity-Tools/Samples/PoolModule/ItemFactory.meta b/Assets/Unity-Tools/Demo/PoolModule/ItemFactory.meta similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/ItemFactory.meta rename to Assets/Unity-Tools/Demo/PoolModule/ItemFactory.meta diff --git a/Assets/Unity-Tools/Samples/PoolModule/ItemFactory/Item_A.prefab b/Assets/Unity-Tools/Demo/PoolModule/ItemFactory/Item_A.prefab similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/ItemFactory/Item_A.prefab rename to Assets/Unity-Tools/Demo/PoolModule/ItemFactory/Item_A.prefab diff --git a/Assets/Unity-Tools/Samples/PoolModule/ItemFactory/Item_A.prefab.meta b/Assets/Unity-Tools/Demo/PoolModule/ItemFactory/Item_A.prefab.meta similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/ItemFactory/Item_A.prefab.meta rename to Assets/Unity-Tools/Demo/PoolModule/ItemFactory/Item_A.prefab.meta diff --git a/Assets/Unity-Tools/Samples/PoolModule/ItemFactory/Item_B.prefab b/Assets/Unity-Tools/Demo/PoolModule/ItemFactory/Item_B.prefab similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/ItemFactory/Item_B.prefab rename to Assets/Unity-Tools/Demo/PoolModule/ItemFactory/Item_B.prefab diff --git a/Assets/Unity-Tools/Samples/PoolModule/ItemFactory/Item_B.prefab.meta b/Assets/Unity-Tools/Demo/PoolModule/ItemFactory/Item_B.prefab.meta similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/ItemFactory/Item_B.prefab.meta rename to Assets/Unity-Tools/Demo/PoolModule/ItemFactory/Item_B.prefab.meta diff --git a/Assets/Unity-Tools/Samples/PoolModule/ItemFactory/Item_C.prefab b/Assets/Unity-Tools/Demo/PoolModule/ItemFactory/Item_C.prefab similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/ItemFactory/Item_C.prefab rename to Assets/Unity-Tools/Demo/PoolModule/ItemFactory/Item_C.prefab diff --git a/Assets/Unity-Tools/Samples/PoolModule/ItemFactory/Item_C.prefab.meta b/Assets/Unity-Tools/Demo/PoolModule/ItemFactory/Item_C.prefab.meta similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/ItemFactory/Item_C.prefab.meta rename to Assets/Unity-Tools/Demo/PoolModule/ItemFactory/Item_C.prefab.meta diff --git a/Assets/Unity-Tools/Samples/PoolModule/ItemFactory/Item_D.prefab b/Assets/Unity-Tools/Demo/PoolModule/ItemFactory/Item_D.prefab similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/ItemFactory/Item_D.prefab rename to Assets/Unity-Tools/Demo/PoolModule/ItemFactory/Item_D.prefab diff --git a/Assets/Unity-Tools/Samples/PoolModule/ItemFactory/Item_D.prefab.meta b/Assets/Unity-Tools/Demo/PoolModule/ItemFactory/Item_D.prefab.meta similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/ItemFactory/Item_D.prefab.meta rename to Assets/Unity-Tools/Demo/PoolModule/ItemFactory/Item_D.prefab.meta diff --git a/Assets/Unity-Tools/Samples/PoolModule/Manager.cs b/Assets/Unity-Tools/Demo/PoolModule/Manager.cs similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/Manager.cs rename to Assets/Unity-Tools/Demo/PoolModule/Manager.cs diff --git a/Assets/Unity-Tools/Samples/PoolModule/Manager.cs.meta b/Assets/Unity-Tools/Demo/PoolModule/Manager.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/Manager.cs.meta rename to Assets/Unity-Tools/Demo/PoolModule/Manager.cs.meta diff --git a/Assets/Unity-Tools/Samples/PoolModule/Manager_New.cs b/Assets/Unity-Tools/Demo/PoolModule/Manager_New.cs similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/Manager_New.cs rename to Assets/Unity-Tools/Demo/PoolModule/Manager_New.cs diff --git a/Assets/Unity-Tools/Samples/PoolModule/Manager_New.cs.meta b/Assets/Unity-Tools/Demo/PoolModule/Manager_New.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/Manager_New.cs.meta rename to Assets/Unity-Tools/Demo/PoolModule/Manager_New.cs.meta diff --git a/Assets/Unity-Tools/Samples/PoolModule/PoolModule.unity b/Assets/Unity-Tools/Demo/PoolModule/PoolModule.unity similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/PoolModule.unity rename to Assets/Unity-Tools/Demo/PoolModule/PoolModule.unity diff --git a/Assets/Unity-Tools/Samples/PoolModule/PoolModule.unity.meta b/Assets/Unity-Tools/Demo/PoolModule/PoolModule.unity.meta similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/PoolModule.unity.meta rename to Assets/Unity-Tools/Demo/PoolModule/PoolModule.unity.meta diff --git a/Assets/Unity-Tools/Samples/PoolModule/PoolModule_New.unity b/Assets/Unity-Tools/Demo/PoolModule/PoolModule_New.unity similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/PoolModule_New.unity rename to Assets/Unity-Tools/Demo/PoolModule/PoolModule_New.unity diff --git a/Assets/Unity-Tools/Samples/PoolModule/PoolModule_New.unity.meta b/Assets/Unity-Tools/Demo/PoolModule/PoolModule_New.unity.meta similarity index 100% rename from Assets/Unity-Tools/Samples/PoolModule/PoolModule_New.unity.meta rename to Assets/Unity-Tools/Demo/PoolModule/PoolModule_New.unity.meta diff --git a/Assets/Unity-Tools/Samples/SaveLoad.meta b/Assets/Unity-Tools/Demo/SaveLoad.meta similarity index 100% rename from Assets/Unity-Tools/Samples/SaveLoad.meta rename to Assets/Unity-Tools/Demo/SaveLoad.meta diff --git a/Assets/Unity-Tools/Samples/SaveLoad/Player.cs b/Assets/Unity-Tools/Demo/SaveLoad/Player.cs similarity index 100% rename from Assets/Unity-Tools/Samples/SaveLoad/Player.cs rename to Assets/Unity-Tools/Demo/SaveLoad/Player.cs diff --git a/Assets/Unity-Tools/Samples/SaveLoad/Player.cs.meta b/Assets/Unity-Tools/Demo/SaveLoad/Player.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/SaveLoad/Player.cs.meta rename to Assets/Unity-Tools/Demo/SaveLoad/Player.cs.meta diff --git a/Assets/Unity-Tools/Samples/SaveLoad/SaveLoad.unity b/Assets/Unity-Tools/Demo/SaveLoad/SaveLoad.unity similarity index 100% rename from Assets/Unity-Tools/Samples/SaveLoad/SaveLoad.unity rename to Assets/Unity-Tools/Demo/SaveLoad/SaveLoad.unity diff --git a/Assets/Unity-Tools/Samples/SaveLoad/SaveLoad.unity.meta b/Assets/Unity-Tools/Demo/SaveLoad/SaveLoad.unity.meta similarity index 100% rename from Assets/Unity-Tools/Samples/SaveLoad/SaveLoad.unity.meta rename to Assets/Unity-Tools/Demo/SaveLoad/SaveLoad.unity.meta diff --git a/Assets/Unity-Tools/Samples/Singleton.meta b/Assets/Unity-Tools/Demo/Singleton.meta similarity index 100% rename from Assets/Unity-Tools/Samples/Singleton.meta rename to Assets/Unity-Tools/Demo/Singleton.meta diff --git a/Assets/Unity-Tools/Samples/Singleton/ManagerPersistentHumble.cs b/Assets/Unity-Tools/Demo/Singleton/ManagerPersistentHumble.cs similarity index 100% rename from Assets/Unity-Tools/Samples/Singleton/ManagerPersistentHumble.cs rename to Assets/Unity-Tools/Demo/Singleton/ManagerPersistentHumble.cs diff --git a/Assets/Unity-Tools/Samples/Singleton/ManagerPersistentHumble.cs.meta b/Assets/Unity-Tools/Demo/Singleton/ManagerPersistentHumble.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/Singleton/ManagerPersistentHumble.cs.meta rename to Assets/Unity-Tools/Demo/Singleton/ManagerPersistentHumble.cs.meta diff --git a/Assets/Unity-Tools/Samples/Singleton/Player.cs b/Assets/Unity-Tools/Demo/Singleton/Player.cs similarity index 100% rename from Assets/Unity-Tools/Samples/Singleton/Player.cs rename to Assets/Unity-Tools/Demo/Singleton/Player.cs diff --git a/Assets/Unity-Tools/Samples/Singleton/Player.cs.meta b/Assets/Unity-Tools/Demo/Singleton/Player.cs.meta similarity index 100% rename from Assets/Unity-Tools/Samples/Singleton/Player.cs.meta rename to Assets/Unity-Tools/Demo/Singleton/Player.cs.meta diff --git a/Assets/Unity-Tools/Samples/Singleton/Singleon.unity b/Assets/Unity-Tools/Demo/Singleton/Singleon.unity similarity index 100% rename from Assets/Unity-Tools/Samples/Singleton/Singleon.unity rename to Assets/Unity-Tools/Demo/Singleton/Singleon.unity diff --git a/Assets/Unity-Tools/Samples/Singleton/Singleon.unity.meta b/Assets/Unity-Tools/Demo/Singleton/Singleon.unity.meta similarity index 100% rename from Assets/Unity-Tools/Samples/Singleton/Singleon.unity.meta rename to Assets/Unity-Tools/Demo/Singleton/Singleon.unity.meta diff --git a/Assets/Unity-Tools/Samples/UIElement.meta b/Assets/Unity-Tools/Demo/UIElement.meta similarity index 100% rename from Assets/Unity-Tools/Samples/UIElement.meta rename to Assets/Unity-Tools/Demo/UIElement.meta diff --git a/Assets/Unity-Tools/Samples/UIElement/HealthBar.prefab b/Assets/Unity-Tools/Demo/UIElement/HealthBar.prefab similarity index 100% rename from Assets/Unity-Tools/Samples/UIElement/HealthBar.prefab rename to Assets/Unity-Tools/Demo/UIElement/HealthBar.prefab diff --git a/Assets/Unity-Tools/Samples/UIElement/HealthBar.prefab.meta b/Assets/Unity-Tools/Demo/UIElement/HealthBar.prefab.meta similarity index 100% rename from Assets/Unity-Tools/Samples/UIElement/HealthBar.prefab.meta rename to Assets/Unity-Tools/Demo/UIElement/HealthBar.prefab.meta diff --git a/Assets/Unity-Tools/Samples/UIElement/UIElement.unity b/Assets/Unity-Tools/Demo/UIElement/UIElement.unity similarity index 100% rename from Assets/Unity-Tools/Samples/UIElement/UIElement.unity rename to Assets/Unity-Tools/Demo/UIElement/UIElement.unity diff --git a/Assets/Unity-Tools/Samples/UIElement/UIElement.unity.meta b/Assets/Unity-Tools/Demo/UIElement/UIElement.unity.meta similarity index 100% rename from Assets/Unity-Tools/Samples/UIElement/UIElement.unity.meta rename to Assets/Unity-Tools/Demo/UIElement/UIElement.unity.meta diff --git a/Assets/Unity-Tools/Samples/Unity-Tools.Samples.asmdef b/Assets/Unity-Tools/Demo/Unity-Tools.Samples.asmdef similarity index 100% rename from Assets/Unity-Tools/Samples/Unity-Tools.Samples.asmdef rename to Assets/Unity-Tools/Demo/Unity-Tools.Samples.asmdef diff --git a/Assets/Unity-Tools/Samples/Unity-Tools.Samples.asmdef.meta b/Assets/Unity-Tools/Demo/Unity-Tools.Samples.asmdef.meta similarity index 100% rename from Assets/Unity-Tools/Samples/Unity-Tools.Samples.asmdef.meta rename to Assets/Unity-Tools/Demo/Unity-Tools.Samples.asmdef.meta diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 9f582e3..6575836 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -827,7 +827,7 @@ PlayerSettings: PS5: DOTWEEN QNX: DOTWEEN ReservedCFE: DOTWEEN - Standalone: ODIN_INSPECTOR;ODIN_INSPECTOR_3;ODIN_INSPECTOR_3_1;ODIN_INSPECTOR_3_2;ODIN_INSPECTOR_3_3;DOTWEEN + Standalone: ODIN_INSPECTOR;ODIN_INSPECTOR_3;ODIN_INSPECTOR_3_1;ODIN_INSPECTOR_3_2;ODIN_INSPECTOR_3_3;DOTWEEN;EASY_POOL_DEBUG VisionOS: DOTWEEN WebGL: DOTWEEN Windows Store Apps: DOTWEEN