// Start is called before the first frame update void Start() { GameObject g = new GameObject("KKK"); DontDestroyOnLoad(g); SceneManager.LoadScene("test_scene", LoadSceneMode.Additive); RemoteOperateClient.GetInstance().Sync(); }
internal static RemoteOperateClient GetInstance() { if (_instance != null) { GameObject.DestroyImmediate(_instance.gameObject); } _instance = new GameObject().AddComponent <RemoteOperateClient>(); _instance.name = "_____RemoteOperateClient_____"; DontDestroyOnLoad(_instance); _instance.gameObject.hideFlags = HideFlags.HideInHierarchy; return(_instance); }