26 lines
572 B
C#
26 lines
572 B
C#
using UnityEngine;
|
|
|
|
namespace UFMTESTING1
|
|
{
|
|
/// <summary>
|
|
/// Used to disable or destroy a GameObject when the world start
|
|
/// </summary>
|
|
public class DisableOnStart : MonoBehaviour
|
|
{
|
|
[SerializeField] private GameObject _targetObject;
|
|
[SerializeField] private bool _destroyOnStart = false;
|
|
|
|
void Start()
|
|
{
|
|
if (_destroyOnStart)
|
|
{
|
|
Destroy(this.gameObject);
|
|
}
|
|
else
|
|
{
|
|
_targetObject.SetActive(false);
|
|
}
|
|
}
|
|
}
|
|
}
|