Net.Like.Xue.Tokyo/Assets/BITKit/Unity/Scripts/Scenes/UnityAutoDestroyOnStart.cs

22 lines
426 B
C#
Raw Normal View History

2025-02-25 13:50:01 +08:00
using System.Collections;
using System.Collections.Generic;
2025-03-10 20:36:11 +08:00
using BITKit;
2025-02-25 13:50:01 +08:00
using UnityEngine;
public class UnityAutoDestroyOnStart : MonoBehaviour
{
2025-03-10 20:36:11 +08:00
[SerializeField] private bool inActive;
2025-02-25 13:50:01 +08:00
// Start is called before the first frame update
void Start()
{
2025-03-10 20:36:11 +08:00
if (inActive)
{
gameObject.SetActive(false);
}
else
{
Destroy(gameObject);
}
2025-02-25 13:50:01 +08:00
}
}