You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.1 KiB
C#
40 lines
1.1 KiB
C#
using UnityEngine;
|
|
|
|
namespace Game
|
|
{
|
|
public class ShadowPoolItem : ObjectPoolItemBase
|
|
{
|
|
public GameObject GameObject;
|
|
|
|
protected override void OnCreate()
|
|
{
|
|
base.OnCreate();
|
|
if (GameObject != null) GameObject.SetActive(true);
|
|
}
|
|
|
|
protected override void OnDestroy()
|
|
{
|
|
base.OnDestroy();
|
|
if (GameObject != null) GameObject.SetActive(false);
|
|
}
|
|
}
|
|
|
|
public class ShadowPoolManager : ObjectPoolBase<ShadowPoolManager>
|
|
{
|
|
public ShadowPoolItem CreateSkillPointer(string name)
|
|
{
|
|
var effectNew = Create<ShadowPoolItem>(name, item =>
|
|
{
|
|
var newGo = CreateShadowGo(name);
|
|
item.GameObject = newGo;
|
|
item.GameObject.transform.parent = Root.transform;
|
|
});
|
|
return effectNew;
|
|
}
|
|
|
|
private GameObject CreateShadowGo(string path)
|
|
{
|
|
return PrefabManager.Instance.CreateGo(path);
|
|
}
|
|
}
|
|
} |