From 9ed92c3a6ab184b9842d692be748948901f0e958 Mon Sep 17 00:00:00 2001 From: Shariff Faleel Date: Wed, 2 Aug 2023 15:44:55 -0700 Subject: [PATCH] Quick restructure with unity meta files --- Assets.meta | 8 +++++ Assets/Scripts.meta | 8 +++++ Assets/{ => Scripts}/ExperimentManager.cs | 33 ++----------------- Assets/Scripts/ExperimentManager.cs.meta | 11 +++++++ Assets/ubc.ok.ovilab.uxf.extensions.asmdef | 17 ++++++++++ .../ubc.ok.ovilab.uxf.extensions.asmdef.meta | 7 ++++ CHANGELOG.md.meta | 7 ++++ LICENSE.meta | 7 ++++ README.md.meta | 7 ++++ package.json | 2 ++ package.json.meta | 7 ++++ 11 files changed, 83 insertions(+), 31 deletions(-) create mode 100644 Assets.meta create mode 100644 Assets/Scripts.meta rename Assets/{ => Scripts}/ExperimentManager.cs (93%) create mode 100644 Assets/Scripts/ExperimentManager.cs.meta create mode 100644 Assets/ubc.ok.ovilab.uxf.extensions.asmdef create mode 100644 Assets/ubc.ok.ovilab.uxf.extensions.asmdef.meta create mode 100644 CHANGELOG.md.meta create mode 100644 LICENSE.meta create mode 100644 README.md.meta create mode 100644 package.json.meta diff --git a/Assets.meta b/Assets.meta new file mode 100644 index 0000000..cda8f82 --- /dev/null +++ b/Assets.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 11d36aa5772d29a4587638924abcf5b5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts.meta b/Assets/Scripts.meta new file mode 100644 index 0000000..c37b39b --- /dev/null +++ b/Assets/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 64090f1ed5850ee4ca3e958c3aa46993 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ExperimentManager.cs b/Assets/Scripts/ExperimentManager.cs similarity index 93% rename from Assets/ExperimentManager.cs rename to Assets/Scripts/ExperimentManager.cs index 5d8988f..858c8e9 100644 --- a/Assets/ExperimentManager.cs +++ b/Assets/Scripts/ExperimentManager.cs @@ -4,58 +4,30 @@ using UnityEngine.Networking; using UXF; using Newtonsoft.Json; -using ubc.ok.ovilab.HPUI.Core; using System.Linq; using System; using UnityEngine.UI; -using ubc.ok.ovilab.ViconUnityStream; namespace ubc.ok.ovilab.uxf.extensions { - public class ExperimentManager : MonoBehaviour + public class ExperimentManager : MonoBehaviour { private const string ASK_PROMPT = "When ready ask researcher to proceed with the experiment"; [SerializeField] [Tooltip("The url address to the experiment server.")] string experimentServerUrl = "http://127.0.0.1:5000"; - public List buttonsRoots; - public Color defaultColor = Color.white; - public Color defaultHoverColor = Color.yellow; - public Color targetButtonColor = Color.red; - public Color defaultHighlightColor = Color.green; - public AudioClip hoverAudio; - public AudioClip contactAudio; - public AudioSource audioSource; - public bool disableHover; - public bool disableHoverAudio; - public bool trackJoints = true; // Adding this for performance reasons - public List forceTrackJoints = new List(); // When trackJoints is false, bypass that for the coordinates in this list public Button startNextButton; public TMPro.TMP_Text outputText; public TMPro.TMP_Text displayText; public TMPro.TMP_Text countText; - public ButtonController thumbBaseButton; - public TargetManager targetManager; - - // NOTE: If a calibration function is set, when appropriate - // the CalibrationComplete function also should be - // called. Until then the next block will not get called. - private Dictionary calibrationFunctions = new Dictionary(); #region HIDDEN_VARIABLES - private Dictionary buttons; - private List activeButtons; - private ButtonController targetButton; private System.Random random; private bool blockEnded = true; - private CalibrationState calibrationState = CalibrationState.none; - private Dictionary calibrationParameters; private bool sessionStarted = false; private int participant_index = -1; - private Dictionary> XORGroupFlattened; private int countDisplay_blockNum, countDisplay_blockTotal, countDisplay_trialTotal; - private bool hideNonTargets = false; private BlockData blockData; #endregion @@ -77,7 +49,6 @@ public virtual void Start() startNextButton.onClick.AddListener(OnGoToNextButtonClicked); - // Strating the session after a few seconds StartCoroutine(StartSessionAfterWait(session)); } @@ -93,7 +64,7 @@ private IEnumerator StartSessionAfterWait(Session session) (idx) => StartCoroutine(GetJsonUrl("api/global-data", (jsonText) => { - ConfigGlobalData data = JsonConvert.DeserializeObject(jsonText); + ConfigGlobalData data = JsonConvert.DeserializeObject(jsonText); participant_index = data.participant_index; countDisplay_blockTotal = data.config_length; Debug.Log($"Recieved session data (pp# {participant_index}): {jsonText}"); diff --git a/Assets/Scripts/ExperimentManager.cs.meta b/Assets/Scripts/ExperimentManager.cs.meta new file mode 100644 index 0000000..f752a44 --- /dev/null +++ b/Assets/Scripts/ExperimentManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9f6957a98384950448d43f0e425eb679 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ubc.ok.ovilab.uxf.extensions.asmdef b/Assets/ubc.ok.ovilab.uxf.extensions.asmdef new file mode 100644 index 0000000..33125a6 --- /dev/null +++ b/Assets/ubc.ok.ovilab.uxf.extensions.asmdef @@ -0,0 +1,17 @@ +{ + "name": "ubc.ok.ovilab.uxf.extensions", + "rootNamespace": "", + "references": [ + "GUID:581cccc347938044e8ae3adc4e6d3640", + "GUID:6055be8ebefd69e48b49212b09b47b2f" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/ubc.ok.ovilab.uxf.extensions.asmdef.meta b/Assets/ubc.ok.ovilab.uxf.extensions.asmdef.meta new file mode 100644 index 0000000..cd2804b --- /dev/null +++ b/Assets/ubc.ok.ovilab.uxf.extensions.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8713b6d88ab25ce49a3e631e03f1ab5d +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/CHANGELOG.md.meta b/CHANGELOG.md.meta new file mode 100644 index 0000000..2490b75 --- /dev/null +++ b/CHANGELOG.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 6f96ee28a592dba4abbbea0026ad926f +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LICENSE.meta b/LICENSE.meta new file mode 100644 index 0000000..be16d7b --- /dev/null +++ b/LICENSE.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 90da720bf04d3b249b26a9220afdc05d +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/README.md.meta b/README.md.meta new file mode 100644 index 0000000..37edbfc --- /dev/null +++ b/README.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f32f47d7083ef17499823d71d528b348 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/package.json b/package.json index bc75975..9960d43 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,8 @@ "description": "Extensions for UXF", "unity": "2019.1", "dependencies": { + "com.unity.test-framework": "1.1.31", + "com.unity.textmeshpro": "3.0.6" }, "author": { "name": "MFA Shariff", diff --git a/package.json.meta b/package.json.meta new file mode 100644 index 0000000..cdcce55 --- /dev/null +++ b/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: da98ff91151a55647ad434949c4a0d7a +PackageManifestImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: