예제 #1
0
        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();
            }
        }
예제 #2
0
        //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);
        }
예제 #3
0
        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();
        }