[Unity]C#单例写法
using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.UI;using TMPro;public class Badmanager : MonoBehaviour{ static Badmanager instance; private void Awake() { if (instance != null) Destroy(this); instance = this; }}
页:
[1]