1
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user