Esempio n. 1
0
 void Awake()
 {
     if (_Instance != null)
     {
         Destroy(gameObject);
         return;
     }
     _Instance = this;
     DontDestroyOnLoad(gameObject);
 }
Esempio n. 2
0
 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);
    }
Esempio n. 4
0
    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);
    }