コード例 #1
0
        private static GazeModifierSettings LoadOrCreateDefaultConfiguration()
        {
            bool resourceExists;
            var  settings = GazeModifierSettings.CreateDefaultSettings(out resourceExists);

            if (resourceExists)
            {
                return(settings);
            }

            var sdkPath   = Path.GetDirectoryName(PathHelper.FindPathToClass(typeof(GazeModifierSettings)));
            var filePath  = PathHelper.PathCombine(sdkPath, GazeModifierSettingsAssetPath);
            var assetPath = filePath.Replace(Application.dataPath, "Assets");

            Debug.Log(assetPath);

            if (File.Exists(filePath))
            {
                AssetDatabase.Refresh();
                settings = AssetDatabase.LoadAssetAtPath <GazeModifierSettings>(assetPath);
                return(settings);
            }

            AssetDatabase.CreateAsset(settings, assetPath);
            AssetDatabase.SaveAssets();

            return(settings);
        }
コード例 #2
0
 public GazeModifierProvider(IEyeTrackingProvider provider, ICameraHelper camera = null) : this(provider, GazeModifierSettings.CreateDefaultSettings(), camera, null)
 {
 }
コード例 #3
0
 public GazeModifierProvider() : this(TobiiXR_Settings.GetProvider(AssemblyUtils.EyetrackingProviderType(GazeModifierSettings.CreateDefaultSettings().EyetrackingProviderType)), GazeModifierSettings.CreateDefaultSettings(), new CameraHelper())
 {
 }
コード例 #4
0
 public void Init()
 {
     Settings = LoadOrCreateDefaultConfiguration();
     _typeDropDown.SetSelectedType(Settings.EyetrackingProviderType);
 }
コード例 #5
0
 public GazeModifierSettingsExtension()
 {
     _gazeModifierSettings = LoadOrCreateDefaultConfiguration();
 }
コード例 #6
0
 public GazeModifierFilter() : this(GazeModifierSettings.CreateDefaultSettings(), new CameraHelper())
 {
 }