Commit 3e3a8df4 authored by William Mocaër's avatar William Mocaër
Browse files

modifications with more relative paths

parent 43b60ac1
......@@ -8,7 +8,7 @@
******************************************************************************/
using UnityEngine;
using UnityEngine.VR;
using UnityEngine.XR;
#if UNITY_EDITOR
using UnityEditor;
#endif
......
......@@ -8,7 +8,7 @@
******************************************************************************/
using UnityEngine;
using UnityEngine.VR;
using UnityEngine.XR;
using System;
using System.Collections;
using System.Collections.Generic;
......@@ -290,14 +290,26 @@ namespace Leap.Unity {
protected void OnDestroy() {
LeapVRCameraControl.OnValidCameraParams -= onValidCameraParams;
}
public static bool isPresent()
{
var xrDisplaySubsystems = new List<XRDisplaySubsystem>();
SubsystemManager.GetInstances<XRDisplaySubsystem>(xrDisplaySubsystems);
foreach (var xrDisplay in xrDisplaySubsystems)
{
if (xrDisplay.running)
{
return true;
}
}
return false;
}
protected void Update() {
if (_shouldSetLocalPosition) {
transform.localPosition = transform.forward * deviceInfo.focalPlaneOffset;
_shouldSetLocalPosition = false;
}
if (Input.GetKeyDown(recenter) && UnityEngine.XR.XRSettings.enabled && UnityEngine.XR.XRDevice.isPresent) {
if (Input.GetKeyDown(recenter) && UnityEngine.XR.XRSettings.enabled && isPresent()) {
UnityEngine.XR.InputTracking.Recenter();
}
......
......@@ -8,8 +8,9 @@
******************************************************************************/
using UnityEngine;
using UnityEngine.VR;
using UnityEngine.XR;
using System;
using System.Collections.Generic;
using System.Linq;
public class VRHeightOffset : MonoBehaviour {
......@@ -35,9 +36,21 @@ public class VRHeightOffset : MonoBehaviour {
_deviceOffsets = new DeviceHeightPair[1];
_deviceOffsets[0] = new DeviceHeightPair("oculus", 1f);
}
public static bool isPresent()
{
var xrDisplaySubsystems = new List<XRDisplaySubsystem>();
SubsystemManager.GetInstances<XRDisplaySubsystem>(xrDisplaySubsystems);
foreach (var xrDisplay in xrDisplaySubsystems)
{
if (xrDisplay.running)
{
return true;
}
}
return false;
}
void Start() {
if (UnityEngine.XR.XRDevice.isPresent && UnityEngine.XR.XRSettings.enabled && _deviceOffsets != null) {
if (isPresent() && UnityEngine.XR.XRSettings.enabled && _deviceOffsets != null) {
#if UNITY_5_4_OR_NEWER
string deviceName = UnityEngine.XR.XRSettings.loadedDeviceName;
#else
......
......@@ -62,7 +62,7 @@ namespace Menus.DBManagement.Controller
protected void OnAddDBClicked()
{
DataBase db = new DataBase("DefaultDB", "./Assets/Scripts/Recognizer/DataTools/DataBases", "LeapMotion");
DataBase db = new DataBase("DefaultDB", "./Data/DataBases", "LeapMotion");
DBManager.GetInstance().AddDB(db);
app.model.SetCurrentDB(db);
app.view.RefreshCurrentDB();
......
......@@ -44,9 +44,9 @@ public class UserAppController : MenuController<UserAppApplication>
app.model.SetUsers(UserManager.GetInstance().GetUsers());
SessionManager sm = SessionManager.GetInstance();
app.model.SetSessions(sm.GetSessions("./Assets/Scripts/Recognizer/DataTools/SessionsData"));
app.model.SetSessions(sm.GetSessions("./Data/SessionsData"));
app.model.SetCurrentSession(app.model.GetSessions()[0]);
app.model.SetExercises("./Assets/Scripts/Recognizer/DataTools/ExercisesData");
app.model.SetExercises("./Data/ExercisesData");
app.model.SetFeedbacks(app.model.GetCurrentExercise().FeedBacks);
//app.model.SetEndCondition(app.model.GetCurrentExercise().Duration);
......
......@@ -15,7 +15,7 @@ Singleton which manages UserData instances and the location of the data.
public class DBManager
{
private static DBManager INSTANCE = new DBManager();
public static string CONFIG_PATH = "./Assets/Scripts/Recognizer/DataTools/DataBases/DataBasesConfig";
public static string CONFIG_PATH = "./Data/DataBases/DataBasesConfig";
private DataBase dataBaseSelected;
public static DBManager GetInstance()
......
......@@ -26,7 +26,7 @@ namespace Recognizer.DataTools
/// <param name="dbPath"></param>
/// <param name="deviceType"></param>
/// <param name="iaPath"></param>
public DataBase(string name="DefaultDB",string dbPath="./Assets/Scripts/Recognizer/DataTools/DataBases", string deviceType="KinectV1", string iaPath = "./Assets/Scripts/Recognizer/DataTools/Model")
public DataBase(string name="DefaultDB",string dbPath="./Data/DataBases", string deviceType="KinectV1", string iaPath = "./Data/Model")
{
Regex r = new Regex(@"^\w+");
Regex regexPath = new Regex(@"^(.+)\/([^\/]+)$");
......
......@@ -18,7 +18,7 @@ public class ExerciseManager
private static string _path; //path of the repertory where user data is located
public static ExerciseManager GetInstance(){
_path="./Assets/Scripts/Recognizer/DataTools/ExercisesData"; //Path : to determine
_path="./Data/ExercisesData"; //Path : to determine
return ExerciseManager.INSTANCE;
}
......
fileFormatVersion: 2
guid: 23a40f77c2a1594499465f3496605354
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 752a66d4a9688064baa19115e2211588
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 8aebc233ea4fada44ad05f4fd31fab75
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 93105db112d471c40890db83629065f5
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 1b7cbfe41d1dda949a8cffb53602e952
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: f35da9ba67bcc93439d4d67db51b4903
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: c41724d248776c342ab1de48ecb10dd1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 0ddb320d9c9c43b48870dd8b0e53fb0f
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -18,7 +18,7 @@ public class FeedbackManager
private static string _path; //path of the repertory where user data is located
public static FeedbackManager GetInstance(){
_path="./Assets/Scripts/Recognizer/DataTools/FeedbacksData"; //Path : to determine
_path="./Data/FeedbacksData"; //Path : to determine
return FeedbackManager.INSTANCE;
}
......
......@@ -19,7 +19,7 @@ public class ProgramManager
private static string _path; //path of the repertory where user data is located
public static ProgramManager GetInstance(){
_path="./Assets/Scripts/Recognizer/DataTools/ProgramsData"; //Path : to determine
_path="./Data/ProgramsData"; //Path : to determine
return ProgramManager.INSTANCE;
}
......
fileFormatVersion: 2
guid: 0bc7c3ccd9db7ed408611249fbeadcb2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -15,10 +15,9 @@ Singleton which manages SessionData instances and the location of the data.
public class SessionManager
{
private static SessionManager INSTANCE = new SessionManager();
private static string _path; //path of the repertory where user data is located
private static string _path="./Data/SessionsData"; //path of the repertory where user data is located
public static SessionManager GetInstance(){
_path="./Assets/Scripts/Recognizer/DataTools/SessionsData"; //Path : to determine
return SessionManager.INSTANCE;
}
......@@ -39,6 +38,7 @@ public class SessionManager
*/
public List<SessionData> GetSessions(string path){
List<SessionData> SessionsList = new List<SessionData>();
foreach(string file in Directory.EnumerateFiles(path, "*.xml")){
FileStream fs = new FileStream(file, FileMode.Open);
XmlDictionaryReader reader = XmlDictionaryReader.CreateTextReader(fs, new XmlDictionaryReaderQuotas());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment