void Awake() { if (_Instance != null) { Destroy(gameObject); return; } _Instance = this; DontDestroyOnLoad(gameObject); }
public static TestComPort GetInstance() { if (_Instance == null) { GameObject obj = new GameObject("_TestComPort"); DontDestroyOnLoad(obj); _Instance = obj.AddComponent <TestComPort>(); } return(_Instance); }
public static MyCOMDevice GetInstance() { if (_Instance == null) { GameObject obj = new GameObject("_MyCOMDevice"); DontDestroyOnLoad(obj); _Instance = obj.AddComponent <MyCOMDevice>(); if (pcvr.IsTestHardWare) { TestComPort.GetInstance(); } } return(_Instance); }
static public pcvr GetInstance() { if (Instance == null) { GameObject obj = new GameObject("_PCVR"); DontDestroyOnLoad(obj); Instance = obj.AddComponent <pcvr>(); ScreenLog.init(); if (bIsHardWare) { MyCOMDevice.GetInstance(); } if (HardWareTest.IsTestHardWare) { TestComPort.GetInstance(); } //ScreenLog.Log("open hid***********************"); } return(Instance); }