diff --git a/Unity_ExperimentLibrary/Packages/com.maellacour.experiment-library/Editor.meta b/Unity_ExperimentLibrary/Assets/StreamingAssets.meta similarity index 77% rename from Unity_ExperimentLibrary/Packages/com.maellacour.experiment-library/Editor.meta rename to Unity_ExperimentLibrary/Assets/StreamingAssets.meta index de0a45b..5d7366d 100644 --- a/Unity_ExperimentLibrary/Packages/com.maellacour.experiment-library/Editor.meta +++ b/Unity_ExperimentLibrary/Assets/StreamingAssets.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 706f286d8f329a04dbfd682df355520a +guid: 468d1c7c1422ac74686716d4370c0fe6 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Unity_ExperimentLibrary/Assets/Inputs.meta b/Unity_ExperimentLibrary/Assets/StreamingAssets/Inputs.meta similarity index 100% rename from Unity_ExperimentLibrary/Assets/Inputs.meta rename to Unity_ExperimentLibrary/Assets/StreamingAssets/Inputs.meta diff --git a/Unity_ExperimentLibrary/Assets/Inputs/common_test.csv b/Unity_ExperimentLibrary/Assets/StreamingAssets/Inputs/common_test.csv similarity index 100% rename from Unity_ExperimentLibrary/Assets/Inputs/common_test.csv rename to Unity_ExperimentLibrary/Assets/StreamingAssets/Inputs/common_test.csv diff --git a/Unity_ExperimentLibrary/Assets/Inputs/common_test.csv.meta b/Unity_ExperimentLibrary/Assets/StreamingAssets/Inputs/common_test.csv.meta similarity index 100% rename from Unity_ExperimentLibrary/Assets/Inputs/common_test.csv.meta rename to Unity_ExperimentLibrary/Assets/StreamingAssets/Inputs/common_test.csv.meta diff --git a/Unity_ExperimentLibrary/Packages/com.maellacour.experiment-library/CHANGELOG.md b/Unity_ExperimentLibrary/Packages/com.maellacour.experiment-library/CHANGELOG.md index 70f67d2..50c28ae 100644 --- a/Unity_ExperimentLibrary/Packages/com.maellacour.experiment-library/CHANGELOG.md +++ b/Unity_ExperimentLibrary/Packages/com.maellacour.experiment-library/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Changed + +- **Breaking change**: Refactor file paths for ExperimentLibrary - Use inputs and outputs + ## [2.4.1] - 2024-09-18 ### Fixed diff --git a/Unity_ExperimentLibrary/Packages/com.maellacour.experiment-library/Editor/ExperimentLibrary.Editor.asmdef b/Unity_ExperimentLibrary/Packages/com.maellacour.experiment-library/Editor/ExperimentLibrary.Editor.asmdef deleted file mode 100644 index 1e02799..0000000 --- a/Unity_ExperimentLibrary/Packages/com.maellacour.experiment-library/Editor/ExperimentLibrary.Editor.asmdef +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "ExperimentLibrary.Editor", - "rootNamespace": "", - "references": [ - "GUID:75080061eacad3b4b93102fd10cb432a" - ], - "includePlatforms": [ - "Editor" - ], - "excludePlatforms": [], - "allowUnsafeCode": false, - "overrideReferences": false, - "precompiledReferences": [], - "autoReferenced": true, - "defineConstraints": [], - "versionDefines": [], - "noEngineReferences": false -} diff --git a/Unity_ExperimentLibrary/Packages/com.maellacour.experiment-library/Editor/ExperimentLibrary.Editor.asmdef.meta b/Unity_ExperimentLibrary/Packages/com.maellacour.experiment-library/Editor/ExperimentLibrary.Editor.asmdef.meta deleted file mode 100644 index ee67092..0000000 --- a/Unity_ExperimentLibrary/Packages/com.maellacour.experiment-library/Editor/ExperimentLibrary.Editor.asmdef.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: cdd8c63e83b2d114295491b0bb04b4c2 -AssemblyDefinitionImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Unity_ExperimentLibrary/Packages/com.maellacour.experiment-library/Editor/InputsFileCopy.cs b/Unity_ExperimentLibrary/Packages/com.maellacour.experiment-library/Editor/InputsFileCopy.cs deleted file mode 100644 index 97963b8..0000000 --- a/Unity_ExperimentLibrary/Packages/com.maellacour.experiment-library/Editor/InputsFileCopy.cs +++ /dev/null @@ -1,68 +0,0 @@ -namespace ExperimentLibrary.Editor -{ - using System.IO; - using UnityEditor; - using UnityEditor.Build; - using UnityEditor.Build.Reporting; - using UnityEngine; - - /// - /// Handles the copying of input files to the build output directory before the build process. - /// - public class InputsFileCopy : IPreprocessBuildWithReport - { - /// - /// Gets the callback order for the post-process build step. - /// - public int callbackOrder { get { return 0; } } - - /// - /// Called before the build process is complete. Copies the input files to the build output directory. - /// - /// The report containing information about the build. - public void OnPreprocessBuild(BuildReport report) - { - // Get the folder containing the input files. - string inputsFolder = ExperimentInputs.GetInputsFolder(); - - // Only proceed if the input files folder exists and is not empty - if (Directory.Exists(inputsFolder) && Directory.GetFileSystemEntries(inputsFolder).Length > 0) - { - string parentFolder; - if (report.summary.platform == BuildTarget.StandaloneWindows || - report.summary.platform == BuildTarget.StandaloneWindows64 || - report.summary.platform == BuildTarget.StandaloneLinux64 - ) - { - // Determine the destination folder for the input files. - string dataFolderName = $"{Path.GetFileNameWithoutExtension(report.summary.outputPath)}_Data"; - parentFolder = Path.Combine(Path.GetDirectoryName(report.summary.outputPath), dataFolderName); - } - else if (report.summary.platform == BuildTarget.StandaloneOSX) - { - // Determine the destination folder for the input files. - parentFolder = Path.Combine(report.summary.outputPath, "Contents"); - } - else - { - // Log a warning if the platform is not supported. - Debug.LogWarning($"ExperimentLibrary: Platform {report.summary.platform} is not supported. Input files will not be copied."); - return; - } - - string destinationFolder = Path.Combine(parentFolder, "Inputs"); - // Copy the input files to the destination folder, excluding files with the "meta" extension. - DirectoryExtensions.Copy( - sourceDirName: ExperimentInputs.GetInputsFolder(), - destDirName: destinationFolder, - copySubDirs: true, - extensionExceptions: new string[] { "meta" } - ); - } - else - { - UnityEngine.Debug.Log($"ExperimentLibrary: No input files found in {inputsFolder}. Skipping copy operation."); - } - } - } -} diff --git a/Unity_ExperimentLibrary/Packages/com.maellacour.experiment-library/Editor/InputsFileCopy.cs.meta b/Unity_ExperimentLibrary/Packages/com.maellacour.experiment-library/Editor/InputsFileCopy.cs.meta deleted file mode 100644 index 3f3e85f..0000000 --- a/Unity_ExperimentLibrary/Packages/com.maellacour.experiment-library/Editor/InputsFileCopy.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: db74611d4b33e784f8015de064d32a9a -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Unity_ExperimentLibrary/Packages/com.maellacour.experiment-library/Runtime/ExperimentInputs.cs b/Unity_ExperimentLibrary/Packages/com.maellacour.experiment-library/Runtime/ExperimentInputs.cs index 728df64..f4cc934 100644 --- a/Unity_ExperimentLibrary/Packages/com.maellacour.experiment-library/Runtime/ExperimentInputs.cs +++ b/Unity_ExperimentLibrary/Packages/com.maellacour.experiment-library/Runtime/ExperimentInputs.cs @@ -20,7 +20,7 @@ public class ExperimentInputs /// The path to the inputs folder. public static string GetInputsFolder() { - return Path.Combine(@"" + Application.dataPath, "Inputs"); + return Path.Combine(@"" + Application.streamingAssetsPath, "Inputs"); } /// diff --git a/Unity_ExperimentLibrary/Packages/com.maellacour.experiment-library/Runtime/ExperimentOutputs.cs b/Unity_ExperimentLibrary/Packages/com.maellacour.experiment-library/Runtime/ExperimentOutputs.cs index 2765431..229443e 100644 --- a/Unity_ExperimentLibrary/Packages/com.maellacour.experiment-library/Runtime/ExperimentOutputs.cs +++ b/Unity_ExperimentLibrary/Packages/com.maellacour.experiment-library/Runtime/ExperimentOutputs.cs @@ -19,7 +19,7 @@ public class ExperimentOutputs public static string GetOutputsFolder() { //'@' : prevent the escaping of characters with \. Really useful for paths. - return Path.Combine(@"" + Application.dataPath, "Outputs"); + return Path.Combine(@"" + Application.streamingAssetsPath, "Outputs"); } /// diff --git a/Unity_ExperimentLibrary/ProjectSettings/ProjectSettings.asset b/Unity_ExperimentLibrary/ProjectSettings/ProjectSettings.asset index 2ac63c8..c05e82b 100644 --- a/Unity_ExperimentLibrary/ProjectSettings/ProjectSettings.asset +++ b/Unity_ExperimentLibrary/ProjectSettings/ProjectSettings.asset @@ -137,7 +137,8 @@ PlayerSettings: vulkanEnableCommandBufferRecycling: 1 loadStoreDebugModeEnabled: 0 bundleVersion: 2.4.1 - preloadedAssets: [] + preloadedAssets: + - {fileID: 11400000, guid: 15d447a71e269f947a8a8ed274c8b747, type: 2} metroInputSource: 0 wsaTransparentSwapchain: 0 m_HolographicPauseOnTrackingLoss: 1