BITKit/Src/Unity/Scripts/Scenes/UnityAutoDestroyOnStart.cs

22 lines
426 B
C#

using System.Collections;
using System.Collections.Generic;
using BITKit;
using UnityEngine;
public class UnityAutoDestroyOnStart : MonoBehaviour
{
[SerializeField] private bool inActive;
// Start is called before the first frame update
void Start()
{
if (inActive)
{
gameObject.SetActive(false);
}
else
{
Destroy(gameObject);
}
}
}