标签:iat lse debug mon oid style null mono deb
下面插入代码
本脚本挂在你不想销毁的物体上面
using System.Collections; using System.Collections.Generic; using UnityEngine; public class ExitApp : MonoBehaviour { public static ExitApp instance; //全局唯一性 private void Awake() { if (instance != null) { Debug.Log("严重 : 对象已经存在!"); DestroyImmediate(gameObject); } else { DontDestroyOnLoad(gameObject); instance = this; } } }
标签:iat lse debug mon oid style null mono deb
原文地址:https://www.cnblogs.com/qq2351194611/p/12010364.html