unity-atoms/Examples/Assets/InfinityWaves/Projectile/DestroyMe.cs
Adam Ramberg e4c489c88e WIP
2020-03-11 21:11:27 +01:00

24 lines
438 B
C#

using UnityEngine;
using UnityEngine.Assertions;
using UnityAtoms.BaseAtoms;
public class DestroyMe : MonoBehaviour
{
[SerializeField]
FloatReference _delay = new FloatReference(-1f);
void Start()
{
Assert.IsNotNull(_delay);
if (_delay.Value >= 0f)
{
Destroy(gameObject, _delay.Value);
}
}
public void DestroyImmediate()
{
Destroy(gameObject);
}
}