using System.Collections; using System.Collections.Generic; using UnityEngine; public class Controller : MonoBehaviour { public static Controller ins; public string TipsData; public string username; public string userhead; public void Awake() { // 检查是否已经存在实例,如果存在则销毁当前对象 if (ins != null && ins != this) { Destroy(gameObject); return; } ins = this; DontDestroyOnLoad(gameObject); } // Start is called before the first frame update void Start() { } }