1
This commit is contained in:
@@ -1,18 +1,21 @@
|
||||
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()
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
if (inActive)
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user