39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
![]() |
using Sirenix.OdinInspector;
|
||
|
using UnityEngine;
|
||
|
|
||
|
// ReSharper disable once CheckNamespace
|
||
|
namespace BlueWaterProject
|
||
|
{
|
||
|
public class ObjectPool : MonoBehaviour
|
||
|
{
|
||
|
private void Awake()
|
||
|
{
|
||
|
CreateDefaultSetting();
|
||
|
}
|
||
|
|
||
|
[Button("기본 설정")]
|
||
|
private void CreateDefaultSetting()
|
||
|
{
|
||
|
var objects = transform.Find("Objects");
|
||
|
if (!objects)
|
||
|
{
|
||
|
objects = new GameObject("Objects").transform;
|
||
|
objects.transform.parent = transform;
|
||
|
}
|
||
|
|
||
|
var particles = transform.Find("Particles");
|
||
|
if (!particles)
|
||
|
{
|
||
|
particles = new GameObject("Particles").transform;
|
||
|
particles.transform.parent = transform;
|
||
|
}
|
||
|
|
||
|
var fireballs = particles.Find("Fireballs");
|
||
|
if (!fireballs)
|
||
|
{
|
||
|
fireballs = new GameObject("Fireballs").transform;
|
||
|
fireballs.transform.parent = particles;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|