This commit is contained in:
CortexCore
2023-11-15 23:55:06 +08:00
parent 5446067f91
commit 70247f0242
82 changed files with 3271 additions and 579 deletions

View File

@@ -5,6 +5,7 @@ using UnityEngine;
using BITKit;
using UnityEngine.Events;
using UnityEngine.Pool;
using UnityEngine.UIElements;
namespace BITKit
{
@@ -18,6 +19,8 @@ namespace BITKit
private static VFXService sinleton;
public VFX[] vfxs;
private readonly Dictionary<string, UnityPool<Transform>> pools = new();
[SerializeField] private Optional<int> defaultCapacity;
private void Awake()
{
sinleton = this;
@@ -37,6 +40,8 @@ namespace BITKit
if (TryMatch(out var prefab, keyWords))
{
var pool = pools.Get(prefab.name);
if (defaultCapacity.Allow)
pool.DefaultCapacity = defaultCapacity.Value;
var instance = pool.Get(prefab, transform);
instance.SetPositionAndRotation(location, location);
if (location.forward.sqrMagnitude is not 0)