public static GazeControlComponent Instance()
 {
     instanceObject = (GazeControlComponent)FindObjectOfType(typeof(GazeControlComponent));
             {
                 if (!instanceObject)
                 {
                     GameObject gameObject = new GameObject();
                     gameObject.name = "EyeTrackingController";
                     instanceObject = gameObject.AddComponent(typeof(GazeControlComponent)) as GazeControlComponent;
                 }
             }
         return instanceObject;
 }
Example #2
0
        void Awake()
        {
            if (!instance)
            {
                instance = this;
                DontDestroyOnLoad(gameObject);
                gazeController = new GazeController();

                instance.initEyeThread();
                instance.startEyeThread();
            }
            else
            {
                Destroy(gameObject);
            }
        }
        void Awake()
        {
            if (!instanceObject)
            {
                instanceObject = this;
                DontDestroyOnLoad(gameObject);
                gazeController = new GazeController();

                instanceObject.initEyeThread();
                instanceObject.startEyeThread();
            }
            else
            {
                Destroy(gameObject);
            }
        }
        void Awake()
        {
            GameObject[] etDriver = GameObject.FindGameObjectsWithTag("EyeTracking");
            Debug.Log("ETDriverCount: " + etDriver.Length);
            if (!instance)
            {
                instance = this;
                DontDestroyOnLoad(gameObject);
                gazeController = new GazeController();

                instance.initEyeThread();
                instance.startEyeThread();
            }
            else
            {
                Destroy(gameObject);
            }
        }