private FizzyoFramework() { if (_instance != null) { Debug.Log("fizzprob: "); return; } else { Debug.Log("[FizzyoFramework] Instantiate."); User = new FizzyoUser(); Device = new FizzyoDevice(); Recogniser = new BreathRecogniser(); Achievements = new FizzyoAchievements(); Analytics = new FizzyoAnalytics(); } }
//Singleton instance of the device - There can be only one! public static FizzyoDevice Instance() { if (instance == null) { lock (threadLock) { if (instance == null) { instance = GameObject.FindObjectOfType <FizzyoDevice>(); } if (instance == null) { instance = (new GameObject("FizzyoDevice")).AddComponent <FizzyoDevice>(); } } } return(instance); }
private void InitializeInstance() { if (IsInitialized) { return; } _instance = this; if (Application.isPlaying) { DontDestroyOnLoad(_instance.transform.root); } User = new FizzyoUser(); Device = new FizzyoDevice(); Recogniser = new BreathRecogniser(); Achievements = new FizzyoAchievements(); Analytics = new FizzyoAnalytics(); Session = new FizzyoSession(); }