johnsoncodehk 发表于 2022-4-27 21:25

[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]
查看完整版本: [Unity]C#单例写法