法杖,武器切换
This commit is contained in:
@@ -21,6 +21,9 @@ namespace SLSFramework.LeanPoolAssistance
|
||||
|
||||
protected bool spawnExecuted = false;
|
||||
|
||||
public Action onSpawnAction;
|
||||
public Action onDespawnAction;
|
||||
|
||||
public virtual void OnSpawn()
|
||||
{
|
||||
if (spawnExecuted)
|
||||
@@ -30,6 +33,7 @@ namespace SLSFramework.LeanPoolAssistance
|
||||
|
||||
spawnExecuted = true;
|
||||
despawnTimer = 0;
|
||||
onSpawnAction?.Invoke();
|
||||
|
||||
children = GetComponentsInChildren<IPoolable>().ToList();
|
||||
children.Remove(this);
|
||||
@@ -56,9 +60,10 @@ namespace SLSFramework.LeanPoolAssistance
|
||||
}
|
||||
}
|
||||
|
||||
public void OnDespawn()
|
||||
public virtual void OnDespawn()
|
||||
{
|
||||
spawnExecuted = false;
|
||||
onDespawnAction?.Invoke();
|
||||
children.ForEach(child => child.OnDespawn());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user