diff --git a/.idea/.idea.Pinpoint/.idea/projectSettingsUpdater.xml b/.idea/.idea.Pinpoint/.idea/projectSettingsUpdater.xml index 4bb9f4d2..64af657f 100644 --- a/.idea/.idea.Pinpoint/.idea/projectSettingsUpdater.xml +++ b/.idea/.idea.Pinpoint/.idea/projectSettingsUpdater.xml @@ -1,6 +1,7 @@ - \ No newline at end of file diff --git a/Assets/AddressableAssetsData/AddressableAssetSettings.asset b/Assets/AddressableAssetsData/AddressableAssetSettings.asset index 0a2e394c..42f1d744 100644 --- a/Assets/AddressableAssetsData/AddressableAssetSettings.asset +++ b/Assets/AddressableAssetsData/AddressableAssetSettings.asset @@ -15,22 +15,37 @@ MonoBehaviour: m_DefaultGroup: eb9eb3c822ec72b468349d4e785d6617 m_currentHash: serializedVersion: 2 - Hash: 00000000000000000000000000000000 + Hash: b3af3a77ece41351bcf4459c8498ca0f m_OptimizeCatalogSize: 0 m_BuildRemoteCatalog: 1 - m_BundleLocalCatalog: 0 m_CatalogRequestsTimeout: 0 m_DisableCatalogUpdateOnStart: 0 + m_InternalIdNamingMode: 0 + m_InternalBundleIdMode: 1 + m_AssetLoadMode: 0 + m_BundledAssetProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider + m_AssetBundleProviderType: + m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider m_IgnoreUnsupportedFilesInBuild: 0 m_UniqueBundleIds: 0 + m_EnableJsonCatalog: 0 m_NonRecursiveBuilding: 0 m_CCDEnabled: 0 m_maxConcurrentWebRequests: 500 + m_UseUWRForLocalBundles: 0 + m_BundleTimeout: 0 + m_BundleRetryCount: 0 + m_BundleRedirectLimit: -1 + m_SharedBundleSettings: 0 + m_SharedBundleSettingsCustomGroupIndex: 0 m_ContiguousBundles: 0 m_StripUnityVersionFromBundleBuild: 0 m_DisableVisibleSubAssetRepresentations: 0 - m_ShaderBundleNaming: 0 - m_ShaderBundleCustomNaming: + m_BuiltInBundleNaming: 0 + mBuiltInBundleCustomNaming: m_MonoScriptBundleNaming: 0 m_CheckForContentUpdateRestrictionsOption: 0 m_MonoScriptBundleCustomNaming: @@ -45,13 +60,11 @@ MonoBehaviour: m_overridePlayerVersion: m_GroupAssets: - {fileID: 11400000, guid: f5ef3838dcf03ab4b8a46a08e76e3145, type: 2} - - {fileID: 11400000, guid: d5389119c92750140ac9a693d91d803d, type: 2} - {fileID: 11400000, guid: 3693e87d2b7c0ab4fa203210015d32dc, type: 2} - {fileID: 11400000, guid: 59ffbdc4842bce949811dc8a3f2f6c37, type: 2} + - {fileID: 11400000, guid: d5389119c92750140ac9a693d91d803d, type: 2} - {fileID: 11400000, guid: eaf52d31609aae946b49dc61e431fd89, type: 2} m_BuildSettings: - m_CompileScriptsInVirtualMode: 0 - m_CleanupStreamingAssetsAfterBuilds: 1 m_LogResourceManagerExceptions: 1 m_BundleBuildPath: Temp/com.unity.addressables/AssetBundles m_ProfileSettings: @@ -60,32 +73,32 @@ MonoBehaviour: m_Id: dff9ccd71970d8840aed7a0320906efa m_ProfileName: Default m_Values: - - m_Id: b28712faecae3244489993d74caf0ba7 - m_Value: '[UnityEditor.EditorUserBuildSettings.activeBuildTarget]' - m_Id: 01e3c05280f34834eb3978814847c527 m_Value: '[UnityEngine.AddressableAssets.Addressables.BuildPath]/[BuildTarget]' + - m_Id: 0dbfffed1e7d1434696f5a6193af38d3 + m_Value: 'ServerData/[BuildTarget]' - m_Id: 6e9217891ed892f40b1933afda7ddded m_Value: '{UnityEngine.AddressableAssets.Addressables.RuntimePath}/[BuildTarget]' - - m_Id: 0dbfffed1e7d1434696f5a6193af38d3 - m_Value: ServerData/[BuildTarget] - m_Id: 8b0e868bf8565ef4ba5a95e7d57f666c - m_Value: https://data.virtualbrainlab.org/PinpointData/1.0.3/[BuildTarget] + m_Value: 'https://data.virtualbrainlab.org/PinpointData/2.0.0/[BuildTarget]' + - m_Id: b28712faecae3244489993d74caf0ba7 + m_Value: '[UnityEditor.EditorUserBuildSettings.activeBuildTarget]' m_ProfileEntryNames: - - m_Id: b28712faecae3244489993d74caf0ba7 - m_Name: BuildTarget - m_InlineUsage: 0 - m_Id: 01e3c05280f34834eb3978814847c527 m_Name: LocalBuildPath m_InlineUsage: 0 - - m_Id: 6e9217891ed892f40b1933afda7ddded - m_Name: LocalLoadPath - m_InlineUsage: 0 - m_Id: 0dbfffed1e7d1434696f5a6193af38d3 m_Name: RemoteBuildPath m_InlineUsage: 0 + - m_Id: 6e9217891ed892f40b1933afda7ddded + m_Name: LocalLoadPath + m_InlineUsage: 0 - m_Id: 8b0e868bf8565ef4ba5a95e7d57f666c m_Name: RemoteLoadPath m_InlineUsage: 0 + - m_Id: b28712faecae3244489993d74caf0ba7 + m_Name: BuildTarget + m_InlineUsage: 0 m_ProfileVersion: 1 m_LabelTable: m_LabelNames: @@ -97,45 +110,9 @@ MonoBehaviour: m_CertificateHandlerType: m_AssemblyName: m_ClassName: - m_ActivePlayerDataBuilderIndex: 3 + m_ActivePlayerDataBuilderIndex: 2 m_DataBuilders: - {fileID: 11400000, guid: a9b76b6fc38ca524e83f460f344d47ba, type: 2} - - {fileID: 11400000, guid: 7823640370daec140b301df16cada5bf, type: 2} - {fileID: 11400000, guid: a8d03897e468ca34288b6f19b8c8076e, type: 2} - {fileID: 11400000, guid: 90e8fd157c1476f419b29b740ad030c2, type: 2} m_ActiveProfileId: dff9ccd71970d8840aed7a0320906efa - m_HostingServicesManager: - m_HostingServiceInfos: - - classRef: UnityEditor.AddressableAssets.HostingServices.HttpHostingService, - Unity.Addressables.Editor - dataStore: - m_SerializedData: - - m_AssemblyName: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - m_ClassName: System.Int32 - m_Data: 57613 - m_Key: HostingServicePort - - m_AssemblyName: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - m_ClassName: System.Int32 - m_Data: 0 - m_Key: HostingServiceUploadSpeed - - m_AssemblyName: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - m_ClassName: System.String - m_Data: ServerData/StandaloneWindows64 - m_Key: ContentRoot - - m_AssemblyName: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - m_ClassName: System.Boolean - m_Data: False - m_Key: IsEnabled - - m_AssemblyName: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - m_ClassName: System.String - m_Data: Local Hosting 0 - m_Key: DescriptiveName - - m_AssemblyName: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - m_ClassName: System.Int32 - m_Data: 0 - m_Key: InstanceId - m_Settings: {fileID: 11400000} - m_NextInstanceId: 1 - m_RegisteredServiceTypeRefs: - - UnityEditor.AddressableAssets.HostingServices.HttpHostingService, Unity.Addressables.Editor - m_PingTimeoutInMilliseconds: 5000 diff --git a/Assets/AddressableAssetsData/AssetGroups/Built In Data.asset b/Assets/AddressableAssetsData/AssetGroups/Built In Data.asset index 857e99ca..1e5a0637 100644 --- a/Assets/AddressableAssetsData/AssetGroups/Built In Data.asset +++ b/Assets/AddressableAssetsData/AssetGroups/Built In Data.asset @@ -13,20 +13,9 @@ MonoBehaviour: m_Name: Built In Data m_EditorClassIdentifier: m_GroupName: Built In Data - m_Data: - m_SerializedData: [] m_GUID: 1251e539c379bef4ba9bc3c80d35df43 - m_SerializeEntries: - - m_GUID: Resources - m_Address: Resources - m_ReadOnly: 1 - m_SerializedLabels: [] - - m_GUID: EditorSceneList - m_Address: EditorSceneList - m_ReadOnly: 1 - m_SerializedLabels: [] + m_SerializeEntries: [] m_ReadOnly: 1 m_Settings: {fileID: 11400000, guid: 2d938794e1ac8154b9b50ee21079a3c4, type: 2} m_SchemaSet: - m_Schemas: - - {fileID: 11400000, guid: 6fb9ab587c7174c41aa51c96052a7b55, type: 2} + m_Schemas: [] diff --git a/Assets/AddressableAssetsData/WebGL/addressables_content_state.bin b/Assets/AddressableAssetsData/WebGL/addressables_content_state.bin index 76a2fe97..c13ffa99 100644 Binary files a/Assets/AddressableAssetsData/WebGL/addressables_content_state.bin and b/Assets/AddressableAssetsData/WebGL/addressables_content_state.bin differ diff --git a/Assets/AddressableAssetsData/Windows/addressables_content_state.bin b/Assets/AddressableAssetsData/Windows/addressables_content_state.bin index ba4c1ae7..52ab9e0f 100644 Binary files a/Assets/AddressableAssetsData/Windows/addressables_content_state.bin and b/Assets/AddressableAssetsData/Windows/addressables_content_state.bin differ diff --git a/Assets/DefaultVolumeProfile.asset b/Assets/DefaultVolumeProfile.asset new file mode 100644 index 00000000..b40eda8f --- /dev/null +++ b/Assets/DefaultVolumeProfile.asset @@ -0,0 +1,795 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-2233999508840761921 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 66f335fb1ffd8684294ad653bf1c7564, type: 3} + m_Name: ColorAdjustments + m_EditorClassIdentifier: + active: 1 + postExposure: + m_OverrideState: 1 + m_Value: 0 + contrast: + m_OverrideState: 1 + m_Value: 0 + colorFilter: + m_OverrideState: 1 + m_Value: {r: 1, g: 1, b: 1, a: 1} + hueShift: + m_OverrideState: 1 + m_Value: 0 + saturation: + m_OverrideState: 1 + m_Value: 0 +--- !u!114 &-1605165664502921212 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3eb4b772797da9440885e8bd939e9560, type: 3} + m_Name: ColorCurves + m_EditorClassIdentifier: + active: 1 + master: + m_OverrideState: 1 + m_Value: + k__BackingField: 2 + m_Loop: 0 + m_ZeroValue: 0 + m_Range: 1 + m_Curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + red: + m_OverrideState: 1 + m_Value: + k__BackingField: 2 + m_Loop: 0 + m_ZeroValue: 0 + m_Range: 1 + m_Curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + green: + m_OverrideState: 1 + m_Value: + k__BackingField: 2 + m_Loop: 0 + m_ZeroValue: 0 + m_Range: 1 + m_Curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + blue: + m_OverrideState: 1 + m_Value: + k__BackingField: 2 + m_Loop: 0 + m_ZeroValue: 0 + m_Range: 1 + m_Curve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 1 + outSlope: 1 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + hueVsHue: + m_OverrideState: 1 + m_Value: + k__BackingField: 0 + m_Loop: 1 + m_ZeroValue: 0.5 + m_Range: 1 + m_Curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + hueVsSat: + m_OverrideState: 1 + m_Value: + k__BackingField: 0 + m_Loop: 1 + m_ZeroValue: 0.5 + m_Range: 1 + m_Curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + satVsSat: + m_OverrideState: 1 + m_Value: + k__BackingField: 0 + m_Loop: 0 + m_ZeroValue: 0.5 + m_Range: 1 + m_Curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + lumVsSat: + m_OverrideState: 1 + m_Value: + k__BackingField: 0 + m_Loop: 0 + m_ZeroValue: 0.5 + m_Range: 1 + m_Curve: + serializedVersion: 2 + m_Curve: [] + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 +--- !u!114 &-491110859270068929 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 81180773991d8724ab7f2d216912b564, type: 3} + m_Name: ChromaticAberration + m_EditorClassIdentifier: + active: 1 + intensity: + m_OverrideState: 1 + m_Value: 0 +--- !u!114 &-368029045001234886 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c01700fd266d6914ababb731e09af2eb, type: 3} + m_Name: DepthOfField + m_EditorClassIdentifier: + active: 1 + mode: + m_OverrideState: 1 + m_Value: 0 + gaussianStart: + m_OverrideState: 1 + m_Value: 10 + gaussianEnd: + m_OverrideState: 1 + m_Value: 30 + gaussianMaxRadius: + m_OverrideState: 1 + m_Value: 1 + highQualitySampling: + m_OverrideState: 1 + m_Value: 0 + focusDistance: + m_OverrideState: 1 + m_Value: 10 + aperture: + m_OverrideState: 1 + m_Value: 5.6 + focalLength: + m_OverrideState: 1 + m_Value: 50 + bladeCount: + m_OverrideState: 1 + m_Value: 5 + bladeCurvature: + m_OverrideState: 1 + m_Value: 1 + bladeRotation: + m_OverrideState: 1 + m_Value: 0 +--- !u!114 &-244940636916020023 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 221518ef91623a7438a71fef23660601, type: 3} + m_Name: WhiteBalance + m_EditorClassIdentifier: + active: 1 + temperature: + m_OverrideState: 1 + m_Value: 0 + tint: + m_OverrideState: 1 + m_Value: 0 +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3} + m_Name: DefaultVolumeProfile + m_EditorClassIdentifier: + components: + - {fileID: 3654869180574669359} + - {fileID: 1708626565050889760} + - {fileID: -244940636916020023} + - {fileID: 7764341717281186532} + - {fileID: -491110859270068929} + - {fileID: -2233999508840761921} + - {fileID: 6170172739141258652} + - {fileID: -368029045001234886} + - {fileID: 5285595025999801235} + - {fileID: 8174558588254802136} + - {fileID: 8360757048657935934} + - {fileID: 4999513074986707088} + - {fileID: 490281590347622981} + - {fileID: 4547113280357904290} + - {fileID: 2529440093976583771} + - {fileID: 2295968890007204182} + - {fileID: -1605165664502921212} + - {fileID: 6027786327861637672} + - {fileID: 4396734909207396331} +--- !u!114 &490281590347622981 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cdfbdbb87d3286943a057f7791b43141, type: 3} + m_Name: ChannelMixer + m_EditorClassIdentifier: + active: 1 + redOutRedIn: + m_OverrideState: 1 + m_Value: 100 + redOutGreenIn: + m_OverrideState: 1 + m_Value: 0 + redOutBlueIn: + m_OverrideState: 1 + m_Value: 0 + greenOutRedIn: + m_OverrideState: 1 + m_Value: 0 + greenOutGreenIn: + m_OverrideState: 1 + m_Value: 100 + greenOutBlueIn: + m_OverrideState: 1 + m_Value: 0 + blueOutRedIn: + m_OverrideState: 1 + m_Value: 0 + blueOutGreenIn: + m_OverrideState: 1 + m_Value: 0 + blueOutBlueIn: + m_OverrideState: 1 + m_Value: 100 +--- !u!114 &1708626565050889760 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ccf1aba9553839d41ae37dd52e9ebcce, type: 3} + m_Name: MotionBlur + m_EditorClassIdentifier: + active: 1 + mode: + m_OverrideState: 1 + m_Value: 0 + quality: + m_OverrideState: 1 + m_Value: 0 + intensity: + m_OverrideState: 1 + m_Value: 0 + clamp: + m_OverrideState: 1 + m_Value: 0.05 +--- !u!114 &2295968890007204182 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 29fa0085f50d5e54f8144f766051a691, type: 3} + m_Name: FilmGrain + m_EditorClassIdentifier: + active: 1 + type: + m_OverrideState: 1 + m_Value: 0 + intensity: + m_OverrideState: 1 + m_Value: 0 + response: + m_OverrideState: 1 + m_Value: 0.8 + texture: + m_OverrideState: 1 + m_Value: {fileID: 0} +--- !u!114 &2529440093976583771 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 899c54efeace73346a0a16faa3afe726, type: 3} + m_Name: Vignette + m_EditorClassIdentifier: + active: 1 + color: + m_OverrideState: 1 + m_Value: {r: 0, g: 0, b: 0, a: 1} + center: + m_OverrideState: 1 + m_Value: {x: 0.5, y: 0.5} + intensity: + m_OverrideState: 1 + m_Value: 0 + smoothness: + m_OverrideState: 1 + m_Value: 0.2 + rounded: + m_OverrideState: 1 + m_Value: 0 +--- !u!114 &3654869180574669359 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 97c23e3b12dc18c42a140437e53d3951, type: 3} + m_Name: Tonemapping + m_EditorClassIdentifier: + active: 1 + mode: + m_OverrideState: 1 + m_Value: 0 + neutralHDRRangeReductionMode: + m_OverrideState: 1 + m_Value: 2 + acesPreset: + m_OverrideState: 1 + m_Value: 3 + hueShiftAmount: + m_OverrideState: 1 + m_Value: 0 + detectPaperWhite: + m_OverrideState: 1 + m_Value: 0 + paperWhite: + m_OverrideState: 1 + m_Value: 300 + detectBrightnessLimits: + m_OverrideState: 1 + m_Value: 1 + minNits: + m_OverrideState: 1 + m_Value: 0.005 + maxNits: + m_OverrideState: 1 + m_Value: 1000 +--- !u!114 &4396734909207396331 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6bd486065ce11414fa40e631affc4900, type: 3} + m_Name: ProbeVolumesOptions + m_EditorClassIdentifier: + active: 1 + normalBias: + m_OverrideState: 1 + m_Value: 0.05 + viewBias: + m_OverrideState: 1 + m_Value: 0.1 + scaleBiasWithMinProbeDistance: + m_OverrideState: 1 + m_Value: 0 + samplingNoise: + m_OverrideState: 1 + m_Value: 0.1 + animateSamplingNoise: + m_OverrideState: 1 + m_Value: 1 + leakReductionMode: + m_OverrideState: 1 + m_Value: 2 + minValidDotProductValue: + m_OverrideState: 1 + m_Value: 0.1 + occlusionOnlyReflectionNormalization: + m_OverrideState: 1 + m_Value: 1 + intensityMultiplier: + m_OverrideState: 1 + m_Value: 1 + skyOcclusionIntensityMultiplier: + m_OverrideState: 1 + m_Value: 1 + worldOffset: + m_OverrideState: 1 + m_Value: {x: 0, y: 0, z: 0} +--- !u!114 &4547113280357904290 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 558a8e2b6826cf840aae193990ba9f2e, type: 3} + m_Name: ShadowsMidtonesHighlights + m_EditorClassIdentifier: + active: 1 + shadows: + m_OverrideState: 1 + m_Value: {x: 1, y: 1, z: 1, w: 0} + midtones: + m_OverrideState: 1 + m_Value: {x: 1, y: 1, z: 1, w: 0} + highlights: + m_OverrideState: 1 + m_Value: {x: 1, y: 1, z: 1, w: 0} + shadowsStart: + m_OverrideState: 1 + m_Value: 0 + shadowsEnd: + m_OverrideState: 1 + m_Value: 0.3 + highlightsStart: + m_OverrideState: 1 + m_Value: 0.55 + highlightsEnd: + m_OverrideState: 1 + m_Value: 1 +--- !u!114 &4999513074986707088 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e021b4c809a781e468c2988c016ebbea, type: 3} + m_Name: ColorLookup + m_EditorClassIdentifier: + active: 1 + texture: + m_OverrideState: 1 + m_Value: {fileID: 0} + dimension: 1 + contribution: + m_OverrideState: 1 + m_Value: 0 +--- !u!114 &5285595025999801235 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5485954d14dfb9a4c8ead8edb0ded5b1, type: 3} + m_Name: LiftGammaGain + m_EditorClassIdentifier: + active: 1 + lift: + m_OverrideState: 1 + m_Value: {x: 1, y: 1, z: 1, w: 0} + gamma: + m_OverrideState: 1 + m_Value: {x: 1, y: 1, z: 1, w: 0} + gain: + m_OverrideState: 1 + m_Value: {x: 1, y: 1, z: 1, w: 0} +--- !u!114 &6027786327861637672 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0b2db86121404754db890f4c8dfe81b2, type: 3} + m_Name: Bloom + m_EditorClassIdentifier: + active: 1 + skipIterations: + m_OverrideState: 1 + m_Value: 1 + threshold: + m_OverrideState: 1 + m_Value: 0.9 + intensity: + m_OverrideState: 1 + m_Value: 0 + scatter: + m_OverrideState: 1 + m_Value: 0.7 + clamp: + m_OverrideState: 1 + m_Value: 65472 + tint: + m_OverrideState: 1 + m_Value: {r: 1, g: 1, b: 1, a: 1} + highQualityFiltering: + m_OverrideState: 1 + m_Value: 0 + downscale: + m_OverrideState: 1 + m_Value: 0 + maxIterations: + m_OverrideState: 1 + m_Value: 6 + dirtTexture: + m_OverrideState: 1 + m_Value: {fileID: 0} + dimension: 1 + dirtIntensity: + m_OverrideState: 1 + m_Value: 0 +--- !u!114 &6170172739141258652 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 06437c1ff663d574d9447842ba0a72e4, type: 3} + m_Name: ScreenSpaceLensFlare + m_EditorClassIdentifier: + active: 1 + intensity: + m_OverrideState: 1 + m_Value: 0 + tintColor: + m_OverrideState: 1 + m_Value: {r: 1, g: 1, b: 1, a: 1} + bloomMip: + m_OverrideState: 1 + m_Value: 1 + firstFlareIntensity: + m_OverrideState: 1 + m_Value: 1 + secondaryFlareIntensity: + m_OverrideState: 1 + m_Value: 1 + warpedFlareIntensity: + m_OverrideState: 1 + m_Value: 1 + warpedFlareScale: + m_OverrideState: 1 + m_Value: {x: 1, y: 1} + samples: + m_OverrideState: 1 + m_Value: 1 + sampleDimmer: + m_OverrideState: 1 + m_Value: 0.5 + vignetteEffect: + m_OverrideState: 1 + m_Value: 1 + startingPosition: + m_OverrideState: 1 + m_Value: 1.25 + scale: + m_OverrideState: 1 + m_Value: 1.5 + streaksIntensity: + m_OverrideState: 1 + m_Value: 0 + streaksLength: + m_OverrideState: 1 + m_Value: 0.5 + streaksOrientation: + m_OverrideState: 1 + m_Value: 0 + streaksThreshold: + m_OverrideState: 1 + m_Value: 0.25 + resolution: + m_OverrideState: 1 + m_Value: 4 + chromaticAbberationIntensity: + m_OverrideState: 1 + m_Value: 0.5 +--- !u!114 &7764341717281186532 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c5e1dc532bcb41949b58bc4f2abfbb7e, type: 3} + m_Name: LensDistortion + m_EditorClassIdentifier: + active: 1 + intensity: + m_OverrideState: 1 + m_Value: 0 + xMultiplier: + m_OverrideState: 1 + m_Value: 1 + yMultiplier: + m_OverrideState: 1 + m_Value: 1 + center: + m_OverrideState: 1 + m_Value: {x: 0.5, y: 0.5} + scale: + m_OverrideState: 1 + m_Value: 1 +--- !u!114 &8174558588254802136 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fb60a22f311433c4c962b888d1393f88, type: 3} + m_Name: PaniniProjection + m_EditorClassIdentifier: + active: 1 + distance: + m_OverrideState: 1 + m_Value: 0 + cropToFit: + m_OverrideState: 1 + m_Value: 1 +--- !u!114 &8360757048657935934 +MonoBehaviour: + m_ObjectHideFlags: 3 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 70afe9e12c7a7ed47911bb608a23a8ff, type: 3} + m_Name: SplitToning + m_EditorClassIdentifier: + active: 1 + shadows: + m_OverrideState: 1 + m_Value: {r: 0.5, g: 0.5, b: 0.5, a: 1} + highlights: + m_OverrideState: 1 + m_Value: {r: 0.5, g: 0.5, b: 0.5, a: 1} + balance: + m_OverrideState: 1 + m_Value: 0 diff --git a/Assets/DefaultVolumeProfile.asset.meta b/Assets/DefaultVolumeProfile.asset.meta new file mode 100644 index 00000000..faf04878 --- /dev/null +++ b/Assets/DefaultVolumeProfile.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 05a554b5d96cb37499e68e86e5c02903 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Editor/ModelsManager.cs b/Assets/Editor/ModelsManager.cs index a753da8b..b914bf35 100644 --- a/Assets/Editor/ModelsManager.cs +++ b/Assets/Editor/ModelsManager.cs @@ -1,7 +1,10 @@ +using System.Collections; using System.IO; using System.Net; +using Unity.EditorCoroutines.Editor; using UnityEditor; using UnityEngine; +using UnityEngine.Networking; namespace Editor { @@ -25,18 +28,14 @@ public static void UpdateSchemas() private static void GetSchemas(string srcURL, string outFile) { + if (!Directory.Exists(outFile)) Directory.CreateDirectory(outFile); - if (!Directory.Exists(outFile)) - { - Directory.CreateDirectory(outFile); - } - - string[] files = Directory.GetFiles(srcURL, "*.cs"); + var files = Directory.GetFiles(srcURL, "*.cs"); - foreach (string file in files) + foreach (var file in files) { - string fileName = Path.GetFileName(file); - string destFilePath = Path.Combine(outFile, fileName); + var fileName = Path.GetFileName(file); + var destFilePath = Path.Combine(outFile, fileName); File.Copy(file, destFilePath, true); } diff --git a/Assets/InputSystem/ProbeControlInputActions.cs b/Assets/InputSystem/ProbeControlInputActions.cs index 9e4f3182..684ba9f7 100644 --- a/Assets/InputSystem/ProbeControlInputActions.cs +++ b/Assets/InputSystem/ProbeControlInputActions.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator -// version 1.7.0 +// version 1.9.0 // from Assets/InputSystem/ProbeControlInputActions.inputactions // // Changes to this file may cause incorrect behavior and will be lost if @@ -14,6 +14,7 @@ using System.Collections.Generic; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Utilities; +using UnityEngine; public partial class @ProbeControlInputActions: IInputActionCollection2, IDisposable { @@ -592,6 +593,11 @@ public @ProbeControlInputActions() m_ProbeControl_InputControl = m_ProbeControl.FindAction("InputControl", throwIfNotFound: true); } + ~@ProbeControlInputActions() + { + Debug.Assert(!m_ProbeControl.enabled, "This will cause a leak and performance issues, ProbeControlInputActions.ProbeControl.Disable() has not been called."); + } + public void Dispose() { UnityEngine.Object.Destroy(asset); diff --git a/Assets/InputSystem/ProbeMetaControls.cs b/Assets/InputSystem/ProbeMetaControls.cs index 535269b1..60696cc9 100644 --- a/Assets/InputSystem/ProbeMetaControls.cs +++ b/Assets/InputSystem/ProbeMetaControls.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator -// version 1.7.0 +// version 1.9.0 // from Assets/InputSystem/ProbeMetaControls.inputactions // // Changes to this file may cause incorrect behavior and will be lost if @@ -14,6 +14,7 @@ using System.Collections.Generic; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Utilities; +using UnityEngine; public partial class @ProbeMetaControls: IInputActionCollection2, IDisposable { @@ -134,6 +135,11 @@ public @ProbeMetaControls() m_ProbeMetaControl_SwitchAxisMode = m_ProbeMetaControl.FindAction("SwitchAxisMode", throwIfNotFound: true); } + ~@ProbeMetaControls() + { + Debug.Assert(!m_ProbeMetaControl.enabled, "This will cause a leak and performance issues, ProbeMetaControls.ProbeMetaControl.Disable() has not been called."); + } + public void Dispose() { UnityEngine.Object.Destroy(asset); diff --git a/Assets/Materials/BrainRegion/BrainRegionOpaqueLit.mat b/Assets/Materials/BrainRegion/BrainRegionOpaqueLit.mat index 60f82caf..a34cc45b 100644 --- a/Assets/Materials/BrainRegion/BrainRegionOpaqueLit.mat +++ b/Assets/Materials/BrainRegion/BrainRegionOpaqueLit.mat @@ -18,7 +18,8 @@ Material: m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} - disabledShaderPasses: [] + disabledShaderPasses: + - MOTIONVECTORS m_LockedProperties: m_SavedProperties: serializedVersion: 3 @@ -120,6 +121,7 @@ Material: - _MLClip: {r: 0, g: 11.4, b: 0, a: 0} - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!114 &7950688029384146499 MonoBehaviour: m_ObjectHideFlags: 11 @@ -132,4 +134,4 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 7 + version: 9 diff --git a/Assets/Materials/BrainRegion/BrainRegionOpaqueUnlit.mat b/Assets/Materials/BrainRegion/BrainRegionOpaqueUnlit.mat index ada06e3a..dcfd40ec 100644 --- a/Assets/Materials/BrainRegion/BrainRegionOpaqueUnlit.mat +++ b/Assets/Materials/BrainRegion/BrainRegionOpaqueUnlit.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 7 + version: 9 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -31,7 +31,8 @@ Material: m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} - disabledShaderPasses: [] + disabledShaderPasses: + - MOTIONVECTORS m_LockedProperties: m_SavedProperties: serializedVersion: 3 @@ -127,3 +128,4 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/Materials/BrainRegion/BrainRegionTransparentLit.mat b/Assets/Materials/BrainRegion/BrainRegionTransparentLit.mat index 2b7b47d0..d83f19c0 100644 --- a/Assets/Materials/BrainRegion/BrainRegionTransparentLit.mat +++ b/Assets/Materials/BrainRegion/BrainRegionTransparentLit.mat @@ -18,7 +18,8 @@ Material: m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} - disabledShaderPasses: [] + disabledShaderPasses: + - MOTIONVECTORS m_LockedProperties: m_SavedProperties: serializedVersion: 3 @@ -117,6 +118,7 @@ Material: - _MLClip: {r: 0, g: 11.4, b: 0, a: 0} - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!114 &1531999738427662394 MonoBehaviour: m_ObjectHideFlags: 11 @@ -129,4 +131,4 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 7 + version: 9 diff --git a/Assets/Materials/BrainRegion/BrainRegionTransparentUnlit.mat b/Assets/Materials/BrainRegion/BrainRegionTransparentUnlit.mat index 1eb713ba..0b0bfa8f 100644 --- a/Assets/Materials/BrainRegion/BrainRegionTransparentUnlit.mat +++ b/Assets/Materials/BrainRegion/BrainRegionTransparentUnlit.mat @@ -18,7 +18,8 @@ Material: m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} - disabledShaderPasses: [] + disabledShaderPasses: + - MOTIONVECTORS m_LockedProperties: m_SavedProperties: serializedVersion: 3 @@ -117,6 +118,7 @@ Material: - _MLClip: {r: 0, g: 11.4, b: 0, a: 0} - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!114 &1531999738427662394 MonoBehaviour: m_ObjectHideFlags: 11 @@ -129,4 +131,4 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 7 + version: 9 diff --git a/Assets/Materials/CraniotomyMaterial.mat b/Assets/Materials/CraniotomyMaterial.mat index 812eb4bf..30c76e87 100644 --- a/Assets/Materials/CraniotomyMaterial.mat +++ b/Assets/Materials/CraniotomyMaterial.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 7 + version: 9 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -36,6 +36,7 @@ Material: disabledShaderPasses: - SHADOWCASTER - DepthOnly + - MOTIONVECTORS m_LockedProperties: m_SavedProperties: serializedVersion: 3 @@ -134,3 +135,4 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/Materials/EphysAtlasLineMaterial.mat b/Assets/Materials/EphysAtlasLineMaterial.mat index 85ad055d..1aacc64f 100644 --- a/Assets/Materials/EphysAtlasLineMaterial.mat +++ b/Assets/Materials/EphysAtlasLineMaterial.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 7 + version: 9 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -32,7 +32,8 @@ Material: m_CustomRenderQueue: 2000 stringTagMap: RenderType: Opaque - disabledShaderPasses: [] + disabledShaderPasses: + - MOTIONVECTORS m_LockedProperties: m_SavedProperties: serializedVersion: 3 @@ -132,3 +133,4 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/Materials/LitGrey.mat b/Assets/Materials/LitGrey.mat index d77a7d83..77016c03 100644 --- a/Assets/Materials/LitGrey.mat +++ b/Assets/Materials/LitGrey.mat @@ -19,7 +19,8 @@ Material: m_CustomRenderQueue: -1 stringTagMap: RenderType: Opaque - disabledShaderPasses: [] + disabledShaderPasses: + - MOTIONVECTORS m_LockedProperties: m_SavedProperties: serializedVersion: 3 @@ -118,6 +119,7 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!114 &5545177365015435086 MonoBehaviour: m_ObjectHideFlags: 11 @@ -130,4 +132,4 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 7 + version: 9 diff --git a/Assets/Materials/Probe/GoldConnectorCable.mat b/Assets/Materials/Probe/GoldConnectorCable.mat index 0eae63dc..364a8a18 100644 --- a/Assets/Materials/Probe/GoldConnectorCable.mat +++ b/Assets/Materials/Probe/GoldConnectorCable.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 7 + version: 9 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -32,7 +32,8 @@ Material: m_CustomRenderQueue: 2000 stringTagMap: RenderType: Opaque - disabledShaderPasses: [] + disabledShaderPasses: + - MOTIONVECTORS m_LockedProperties: m_SavedProperties: serializedVersion: 3 @@ -131,3 +132,4 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/Materials/Probe/Green.mat b/Assets/Materials/Probe/Green.mat index 0b857a5a..987e0380 100644 --- a/Assets/Materials/Probe/Green.mat +++ b/Assets/Materials/Probe/Green.mat @@ -19,7 +19,8 @@ Material: m_CustomRenderQueue: 2000 stringTagMap: RenderType: Opaque - disabledShaderPasses: [] + disabledShaderPasses: + - MOTIONVECTORS m_LockedProperties: m_SavedProperties: serializedVersion: 3 @@ -118,6 +119,7 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!114 &2484206933931674713 MonoBehaviour: m_ObjectHideFlags: 11 @@ -130,4 +132,4 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 7 + version: 9 diff --git a/Assets/Materials/Probe/IBLProbeMaterial.mat b/Assets/Materials/Probe/IBLProbeMaterial.mat index 7fc4857e..4d29ecf1 100644 --- a/Assets/Materials/Probe/IBLProbeMaterial.mat +++ b/Assets/Materials/Probe/IBLProbeMaterial.mat @@ -20,7 +20,8 @@ Material: m_CustomRenderQueue: 2000 stringTagMap: RenderType: Opaque - disabledShaderPasses: [] + disabledShaderPasses: + - MOTIONVECTORS m_LockedProperties: m_SavedProperties: serializedVersion: 3 @@ -119,6 +120,7 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!114 &8990643678099489018 MonoBehaviour: m_ObjectHideFlags: 11 @@ -131,4 +133,4 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 7 + version: 9 diff --git a/Assets/Materials/Probe/LitBlackMaterial.mat b/Assets/Materials/Probe/LitBlackMaterial.mat index 52972597..d2023f9b 100644 --- a/Assets/Materials/Probe/LitBlackMaterial.mat +++ b/Assets/Materials/Probe/LitBlackMaterial.mat @@ -19,7 +19,8 @@ Material: m_CustomRenderQueue: 2000 stringTagMap: RenderType: Opaque - disabledShaderPasses: [] + disabledShaderPasses: + - MOTIONVECTORS m_LockedProperties: m_SavedProperties: serializedVersion: 3 @@ -118,6 +119,7 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!114 &5791354437846213698 MonoBehaviour: m_ObjectHideFlags: 11 @@ -130,4 +132,4 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 7 + version: 9 diff --git a/Assets/Materials/Probe/NeuronMaterial.mat b/Assets/Materials/Probe/NeuronMaterial.mat index b3f852bb..5b6403b5 100644 --- a/Assets/Materials/Probe/NeuronMaterial.mat +++ b/Assets/Materials/Probe/NeuronMaterial.mat @@ -18,7 +18,8 @@ Material: m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} - disabledShaderPasses: [] + disabledShaderPasses: + - MOTIONVECTORS m_LockedProperties: m_SavedProperties: serializedVersion: 3 @@ -115,6 +116,7 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!114 &2666491075564505777 MonoBehaviour: m_ObjectHideFlags: 11 @@ -127,4 +129,4 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 7 + version: 9 diff --git a/Assets/Materials/ProbeMaterial.mat b/Assets/Materials/ProbeMaterial.mat index f1cb3b87..3d15dd0b 100644 --- a/Assets/Materials/ProbeMaterial.mat +++ b/Assets/Materials/ProbeMaterial.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 7 + version: 9 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -36,6 +36,7 @@ Material: disabledShaderPasses: - SHADOWCASTER - DepthOnly + - MOTIONVECTORS m_LockedProperties: m_SavedProperties: serializedVersion: 3 @@ -141,3 +142,4 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/Materials/ProbeTransparentMaterial.mat b/Assets/Materials/ProbeTransparentMaterial.mat index fc24d173..5c8d4d86 100644 --- a/Assets/Materials/ProbeTransparentMaterial.mat +++ b/Assets/Materials/ProbeTransparentMaterial.mat @@ -23,6 +23,7 @@ Material: disabledShaderPasses: - SHADOWCASTER - DepthOnly + - MOTIONVECTORS m_LockedProperties: m_SavedProperties: serializedVersion: 3 @@ -122,6 +123,7 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!114 &8489137983973626414 MonoBehaviour: m_ObjectHideFlags: 11 @@ -134,4 +136,4 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 7 + version: 9 diff --git a/Assets/Materials/SiteMaterial.mat b/Assets/Materials/SiteMaterial.mat index 6901fcce..763b1c9f 100644 --- a/Assets/Materials/SiteMaterial.mat +++ b/Assets/Materials/SiteMaterial.mat @@ -19,7 +19,8 @@ Material: m_CustomRenderQueue: 2000 stringTagMap: RenderType: Opaque - disabledShaderPasses: [] + disabledShaderPasses: + - MOTIONVECTORS m_LockedProperties: m_SavedProperties: serializedVersion: 3 @@ -120,6 +121,7 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!114 &1523391536134859176 MonoBehaviour: m_ObjectHideFlags: 11 @@ -132,4 +134,4 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 7 + version: 9 diff --git a/Assets/Materials/SkullMaterial.mat b/Assets/Materials/SkullMaterial.mat index d5ad3da1..5a4fd0e3 100644 --- a/Assets/Materials/SkullMaterial.mat +++ b/Assets/Materials/SkullMaterial.mat @@ -18,7 +18,8 @@ Material: m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} - disabledShaderPasses: [] + disabledShaderPasses: + - MOTIONVECTORS m_LockedProperties: m_SavedProperties: serializedVersion: 3 @@ -128,6 +129,7 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!114 &1110752586801046589 MonoBehaviour: m_ObjectHideFlags: 11 @@ -140,4 +142,4 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 7 + version: 9 diff --git a/Assets/Materials/SurfacePointMaterial.mat b/Assets/Materials/SurfacePointMaterial.mat index f023055d..4d724cf6 100644 --- a/Assets/Materials/SurfacePointMaterial.mat +++ b/Assets/Materials/SurfacePointMaterial.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 7 + version: 9 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -34,7 +34,8 @@ Material: m_CustomRenderQueue: 2000 stringTagMap: RenderType: Opaque - disabledShaderPasses: [] + disabledShaderPasses: + - MOTIONVECTORS m_LockedProperties: m_SavedProperties: serializedVersion: 3 @@ -133,3 +134,4 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/Materials/TrajectoryPlanner/CollisionMaterial.mat b/Assets/Materials/TrajectoryPlanner/CollisionMaterial.mat index 3111132b..1e602bbe 100644 --- a/Assets/Materials/TrajectoryPlanner/CollisionMaterial.mat +++ b/Assets/Materials/TrajectoryPlanner/CollisionMaterial.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 7 + version: 9 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -32,7 +32,8 @@ Material: m_CustomRenderQueue: 2000 stringTagMap: RenderType: Opaque - disabledShaderPasses: [] + disabledShaderPasses: + - MOTIONVECTORS m_LockedProperties: m_SavedProperties: serializedVersion: 3 @@ -132,3 +133,4 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/Materials/TrajectoryPlanner/ProbeRecordingChunk.mat b/Assets/Materials/TrajectoryPlanner/ProbeRecordingChunk.mat index 79c51bef..040bfce9 100644 --- a/Assets/Materials/TrajectoryPlanner/ProbeRecordingChunk.mat +++ b/Assets/Materials/TrajectoryPlanner/ProbeRecordingChunk.mat @@ -19,7 +19,8 @@ Material: m_CustomRenderQueue: 2000 stringTagMap: RenderType: Opaque - disabledShaderPasses: [] + disabledShaderPasses: + - MOTIONVECTORS m_LockedProperties: m_SavedProperties: serializedVersion: 3 @@ -119,6 +120,7 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!114 &7200608012259704473 MonoBehaviour: m_ObjectHideFlags: 11 @@ -131,4 +133,4 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 7 + version: 9 diff --git a/Assets/Materials/TrajectoryPlanner/SensapexMetal.mat b/Assets/Materials/TrajectoryPlanner/SensapexMetal.mat index cbc15fb0..55a8abce 100644 --- a/Assets/Materials/TrajectoryPlanner/SensapexMetal.mat +++ b/Assets/Materials/TrajectoryPlanner/SensapexMetal.mat @@ -19,7 +19,8 @@ Material: m_CustomRenderQueue: 2000 stringTagMap: RenderType: Opaque - disabledShaderPasses: [] + disabledShaderPasses: + - MOTIONVECTORS m_LockedProperties: m_SavedProperties: serializedVersion: 3 @@ -118,6 +119,7 @@ Material: - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!114 &4492099221454130244 MonoBehaviour: m_ObjectHideFlags: 11 @@ -130,4 +132,4 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 7 + version: 9 diff --git a/Assets/Materials/Volume/InPlaneSliceMaterial.mat b/Assets/Materials/Volume/InPlaneSliceMaterial.mat index 1c529c41..cbb159ca 100644 --- a/Assets/Materials/Volume/InPlaneSliceMaterial.mat +++ b/Assets/Materials/Volume/InPlaneSliceMaterial.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 7 + version: 9 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -31,7 +31,8 @@ Material: m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} - disabledShaderPasses: [] + disabledShaderPasses: + - MOTIONVECTORS m_LockedProperties: m_SavedProperties: serializedVersion: 3 @@ -154,3 +155,4 @@ Material: - _UpDirection: {r: 0, g: 1, b: 0, a: 0} - _VolumeSize: {r: 528, g: 320, b: 456, a: 0} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/Materials/Volume/ProbePanelChannelMaterial.mat b/Assets/Materials/Volume/ProbePanelChannelMaterial.mat index 83748463..f579d362 100644 --- a/Assets/Materials/Volume/ProbePanelChannelMaterial.mat +++ b/Assets/Materials/Volume/ProbePanelChannelMaterial.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 7 + version: 9 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -31,7 +31,8 @@ Material: m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} - disabledShaderPasses: [] + disabledShaderPasses: + - MOTIONVECTORS m_LockedProperties: m_SavedProperties: serializedVersion: 3 @@ -141,3 +142,4 @@ Material: - _SpecColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} - _TipPosition: {r: 0, g: 0, b: 0, a: 0} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/Materials/Volume/ProbePanelSliceMaterial.mat b/Assets/Materials/Volume/ProbePanelSliceMaterial.mat index 935394e3..35300123 100644 --- a/Assets/Materials/Volume/ProbePanelSliceMaterial.mat +++ b/Assets/Materials/Volume/ProbePanelSliceMaterial.mat @@ -12,7 +12,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} m_Name: m_EditorClassIdentifier: - version: 7 + version: 9 --- !u!21 &2100000 Material: serializedVersion: 8 @@ -31,7 +31,8 @@ Material: m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} - disabledShaderPasses: [] + disabledShaderPasses: + - MOTIONVECTORS m_LockedProperties: m_SavedProperties: serializedVersion: 3 @@ -145,3 +146,4 @@ Material: - _TipPosition: {r: 78, g: 185, b: 230, a: 0} - _UpAxis: {r: 0, g: 0, b: 0, a: 0} m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/Plugins/unity_js_link.jslib b/Assets/Plugins/unity_js_link.jslib index 2005faa1..c7c71e2a 100644 --- a/Assets/Plugins/unity_js_link.jslib +++ b/Assets/Plugins/unity_js_link.jslib @@ -5,6 +5,14 @@ mergeInto(LibraryManager.library, { console.log('copy2clipboard called: ' + str); copy2clipboardStr = str; canvas.addEventListener('click', copy2clipboardCallback, false); + }, + + SelectPID: function (pid) { + window.alert(UTF8ToString(pid)); + }, + + DownloadFile: function(filename, filedata) { + downloadFile(filename, filedata); } }); \ No newline at end of file diff --git a/Assets/Prefabs/UI/EphysCopilot/InsertionSelectionPanel.prefab b/Assets/Prefabs/UI/EphysCopilot/InsertionSelectionPanel.prefab index bbdc2114..a530ab8e 100644 --- a/Assets/Prefabs/UI/EphysCopilot/InsertionSelectionPanel.prefab +++ b/Assets/Prefabs/UI/EphysCopilot/InsertionSelectionPanel.prefab @@ -32,7 +32,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 5103970214871766003} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -112,15 +111,17 @@ MonoBehaviour: m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 - m_enableWordWrapping: 1 + m_TextWrappingMode: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 m_linkedTextComponent: {fileID: 0} parentLinkedComponent: {fileID: 0} m_enableKerning: 1 + m_ActiveFontFeatures: 6e72656b m_enableExtraPadding: 0 checkPaddingRequired: 0 m_isRichText: 1 + m_EmojiFallbackSupport: 1 m_parseCtrlCharacters: 1 m_isOrthographic: 1 m_isCullingEnabled: 0 @@ -192,7 +193,6 @@ RectTransform: - {fileID: 3299314768057195748} - {fileID: 5443312132586863250} m_Father: {fileID: 6312497235516384231} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 1, y: 0.5} @@ -292,7 +292,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1334401237401123798} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 1, y: 0.5} m_AnchorMax: {x: 1, y: 0.5} @@ -370,7 +369,6 @@ RectTransform: m_Children: - {fileID: 3653181643625187054} m_Father: {fileID: 2967243177907657535} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 1, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -495,7 +493,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 6044053482212494243} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -573,15 +570,17 @@ MonoBehaviour: m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 - m_enableWordWrapping: 1 + m_TextWrappingMode: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 m_linkedTextComponent: {fileID: 0} parentLinkedComponent: {fileID: 0} m_enableKerning: 1 + m_ActiveFontFeatures: 6e72656b m_enableExtraPadding: 0 checkPaddingRequired: 0 m_isRichText: 1 + m_EmojiFallbackSupport: 1 m_parseCtrlCharacters: 1 m_isOrthographic: 1 m_isCullingEnabled: 0 @@ -630,7 +629,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 4625251052424300385} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -709,7 +707,6 @@ RectTransform: - {fileID: 1334401237401123798} - {fileID: 6044053482212494243} m_Father: {fileID: 0} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -792,7 +789,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 4625251052424300385} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 0, y: 0.5} @@ -870,7 +866,6 @@ RectTransform: m_Children: - {fileID: 6312497235516384231} m_Father: {fileID: 2967243177907657535} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -959,7 +954,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 4625251052424300385} - m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -1037,15 +1031,17 @@ MonoBehaviour: m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 - m_enableWordWrapping: 1 + m_TextWrappingMode: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 m_linkedTextComponent: {fileID: 0} parentLinkedComponent: {fileID: 0} m_enableKerning: 1 + m_ActiveFontFeatures: 00000000 m_enableExtraPadding: 0 checkPaddingRequired: 0 m_isRichText: 1 + m_EmojiFallbackSupport: 1 m_parseCtrlCharacters: 1 m_isOrthographic: 1 m_isCullingEnabled: 0 @@ -1099,7 +1095,6 @@ RectTransform: - {fileID: 4429934044767703842} - {fileID: 2967243177907657535} m_Father: {fileID: 5103970214871766003} - m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -1192,14 +1187,18 @@ MonoBehaviour: m_ItemText: {fileID: 7906760482401174147} m_ItemImage: {fileID: 0} m_Value: 0 + m_MultiSelect: 0 m_Options: m_Options: - m_Text: Option A m_Image: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} - m_Text: Option B m_Image: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} - m_Text: Option C m_Image: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} m_OnValueChanged: m_PersistentCalls: m_Calls: @@ -1268,7 +1267,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1334401237401123798} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -1346,15 +1344,17 @@ MonoBehaviour: m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 - m_enableWordWrapping: 1 + m_TextWrappingMode: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 m_linkedTextComponent: {fileID: 0} parentLinkedComponent: {fileID: 0} m_enableKerning: 1 + m_ActiveFontFeatures: 6e72656b m_enableExtraPadding: 0 checkPaddingRequired: 0 m_isRichText: 1 + m_EmojiFallbackSupport: 1 m_parseCtrlCharacters: 1 m_isOrthographic: 1 m_isCullingEnabled: 0 @@ -1402,7 +1402,6 @@ RectTransform: m_Children: - {fileID: 5236390316110336122} m_Father: {fileID: 1523856699623931373} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -1444,7 +1443,6 @@ RectTransform: - {fileID: 2148185415867671841} - {fileID: 1523856699623931373} m_Father: {fileID: 1334401237401123798} - m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 0} @@ -1578,7 +1576,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 3653181643625187054} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} @@ -1653,7 +1650,6 @@ RectTransform: m_Children: - {fileID: 4625251052424300385} m_Father: {fileID: 2148185415867671841} - m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} @@ -1694,7 +1690,6 @@ RectTransform: m_Children: - {fileID: 7156214125293086914} m_Father: {fileID: 5103970214871766003} - m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} diff --git a/Assets/Prefabs/UI/SettingsMenu/Menus/EphysLinkMenu.prefab b/Assets/Prefabs/UI/SettingsMenu/Menus/EphysLinkMenu.prefab index 3210c87c..c0f54f00 100644 --- a/Assets/Prefabs/UI/SettingsMenu/Menus/EphysLinkMenu.prefab +++ b/Assets/Prefabs/UI/SettingsMenu/Menus/EphysLinkMenu.prefab @@ -215,20 +215,27 @@ MonoBehaviour: m_ItemText: {fileID: 3408611123412419985} m_ItemImage: {fileID: 0} m_Value: 0 + m_MultiSelect: 0 m_Options: m_Options: - m_Text: Sensapex uMp-4 m_Image: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} - m_Text: Sensapex uMp-3 m_Image: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} - m_Text: New Scale Pathfinder MPM Control v2.8.8+ m_Image: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} - m_Text: New Scale M3-USB-3:1-EP m_Image: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} - m_Text: Local Server m_Image: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} - m_Text: Proxy Server m_Image: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} m_OnValueChanged: m_PersistentCalls: m_Calls: @@ -426,15 +433,17 @@ MonoBehaviour: m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 - m_enableWordWrapping: 0 + m_TextWrappingMode: 3 m_wordWrappingRatios: 0.4 m_overflowMode: 0 m_linkedTextComponent: {fileID: 0} parentLinkedComponent: {fileID: 0} m_enableKerning: 1 + m_ActiveFontFeatures: 00000000 m_enableExtraPadding: 1 checkPaddingRequired: 0 m_isRichText: 1 + m_EmojiFallbackSupport: 1 m_parseCtrlCharacters: 1 m_isOrthographic: 1 m_isCullingEnabled: 0 @@ -699,10 +708,13 @@ MonoBehaviour: m_GlobalFontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_OnFocusSelectAll: 1 m_ResetOnDeActivation: 1 + m_KeepTextSelectionVisible: 0 m_RestoreOriginalTextOnEscape: 1 m_isRichTextEditingAllowed: 0 m_LineLimit: 0 + isAlert: 0 m_InputValidator: {fileID: 0} + m_ShouldActivateOnSelect: 1 --- !u!114 &9126238235180024932 MonoBehaviour: m_ObjectHideFlags: 0 @@ -831,15 +843,17 @@ MonoBehaviour: m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 - m_enableWordWrapping: 0 + m_TextWrappingMode: 3 m_wordWrappingRatios: 0.4 m_overflowMode: 0 m_linkedTextComponent: {fileID: 0} parentLinkedComponent: {fileID: 0} m_enableKerning: 1 + m_ActiveFontFeatures: 00000000 m_enableExtraPadding: 1 checkPaddingRequired: 0 m_isRichText: 1 + m_EmojiFallbackSupport: 1 m_parseCtrlCharacters: 1 m_isOrthographic: 1 m_isCullingEnabled: 0 @@ -965,15 +979,17 @@ MonoBehaviour: m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 - m_enableWordWrapping: 0 + m_TextWrappingMode: 3 m_wordWrappingRatios: 0.4 m_overflowMode: 0 m_linkedTextComponent: {fileID: 0} parentLinkedComponent: {fileID: 0} m_enableKerning: 1 + m_ActiveFontFeatures: 00000000 m_enableExtraPadding: 1 checkPaddingRequired: 0 m_isRichText: 1 + m_EmojiFallbackSupport: 1 m_parseCtrlCharacters: 1 m_isOrthographic: 1 m_isCullingEnabled: 0 @@ -1210,6 +1226,105 @@ MonoBehaviour: m_FlexibleWidth: -1 m_FlexibleHeight: 1000 m_LayoutPriority: 1 +--- !u!1 &1830552163470348710 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8845940529613449592} + - component: {fileID: 1835709296876419401} + m_Layer: 5 + m_Name: UIToggle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8845940529613449592 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1830552163470348710} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1413684294393245803} + - {fileID: 786153439049702521} + m_Father: {fileID: 3368363359402801633} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1835709296876419401 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1830552163470348710} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 4535217986031248359} + toggleTransition: 1 + graphic: {fileID: 2815442997694183097} + m_Group: {fileID: 0} + onValueChanged: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 4412914667077470364} + m_TargetAssemblyTypeName: Pinpoint.UI.EphysLinkSettings.EphysLinkSettings, + trajectoryplanner.ui.ephyslinksettings + m_MethodName: ToggleNewUI + m_Mode: 0 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_IsOn: 0 --- !u!1 &1994248369407345157 GameObject: m_ObjectHideFlags: 0 @@ -1318,15 +1433,17 @@ MonoBehaviour: m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 - m_enableWordWrapping: 1 + m_TextWrappingMode: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 m_linkedTextComponent: {fileID: 0} parentLinkedComponent: {fileID: 0} m_enableKerning: 1 + m_ActiveFontFeatures: 00000000 m_enableExtraPadding: 0 checkPaddingRequired: 0 m_isRichText: 1 + m_EmojiFallbackSupport: 1 m_parseCtrlCharacters: 1 m_isOrthographic: 1 m_isCullingEnabled: 0 @@ -1464,7 +1581,7 @@ MonoBehaviour: m_TargetGraphic: {fileID: 8665175951857608260} m_HandleRect: {fileID: 2259807623879296756} m_Direction: 2 - m_Value: 0 + m_Value: 1 m_Size: 1 m_NumberOfSteps: 0 m_OnValueChanged: @@ -1642,10 +1759,13 @@ MonoBehaviour: m_GlobalFontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_OnFocusSelectAll: 1 m_ResetOnDeActivation: 1 + m_KeepTextSelectionVisible: 0 m_RestoreOriginalTextOnEscape: 1 m_isRichTextEditingAllowed: 0 m_LineLimit: 0 + isAlert: 0 m_InputValidator: {fileID: 0} + m_ShouldActivateOnSelect: 1 --- !u!114 &4232213226333673226 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1775,15 +1895,17 @@ MonoBehaviour: m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 - m_enableWordWrapping: 0 + m_TextWrappingMode: 0 m_wordWrappingRatios: 0.4 m_overflowMode: 0 m_linkedTextComponent: {fileID: 0} parentLinkedComponent: {fileID: 0} m_enableKerning: 1 + m_ActiveFontFeatures: 00000000 m_enableExtraPadding: 1 checkPaddingRequired: 0 m_isRichText: 1 + m_EmojiFallbackSupport: 1 m_parseCtrlCharacters: 1 m_isOrthographic: 1 m_isCullingEnabled: 0 @@ -1852,6 +1974,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 6454811602450069208} + - {fileID: 8845940529613449592} m_Father: {fileID: 6362176155741130746} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -2247,15 +2370,17 @@ MonoBehaviour: m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 - m_enableWordWrapping: 0 + m_TextWrappingMode: 3 m_wordWrappingRatios: 0.4 m_overflowMode: 0 m_linkedTextComponent: {fileID: 0} parentLinkedComponent: {fileID: 0} m_enableKerning: 1 + m_ActiveFontFeatures: 00000000 m_enableExtraPadding: 1 checkPaddingRequired: 0 m_isRichText: 1 + m_EmojiFallbackSupport: 1 m_parseCtrlCharacters: 1 m_isOrthographic: 1 m_isCullingEnabled: 0 @@ -2273,6 +2398,85 @@ MonoBehaviour: m_hasFontAssetChanged: 0 m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &3489702538691592783 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 786153439049702521} + - component: {fileID: 7385710528594745762} + - component: {fileID: 8914390557635951712} + m_Layer: 5 + m_Name: Label + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &786153439049702521 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3489702538691592783} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 8845940529613449592} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 37.5, y: 0.5} + m_SizeDelta: {x: -85, y: -1.0000191} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &7385710528594745762 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3489702538691592783} + m_CullTransparentMesh: 1 +--- !u!114 &8914390557635951712 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3489702538691592783} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 36 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 3 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Enable New UI (Experimental) --- !u!1 &3505735895688001491 GameObject: m_ObjectHideFlags: 0 @@ -2381,15 +2585,17 @@ MonoBehaviour: m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 - m_enableWordWrapping: 1 + m_TextWrappingMode: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 m_linkedTextComponent: {fileID: 0} parentLinkedComponent: {fileID: 0} m_enableKerning: 1 + m_ActiveFontFeatures: 00000000 m_enableExtraPadding: 0 checkPaddingRequired: 0 m_isRichText: 1 + m_EmojiFallbackSupport: 1 m_parseCtrlCharacters: 1 m_isOrthographic: 1 m_isCullingEnabled: 0 @@ -2516,15 +2722,17 @@ MonoBehaviour: m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 - m_enableWordWrapping: 0 + m_TextWrappingMode: 0 m_wordWrappingRatios: 0.4 m_overflowMode: 0 m_linkedTextComponent: {fileID: 0} parentLinkedComponent: {fileID: 0} m_enableKerning: 1 + m_ActiveFontFeatures: 00000000 m_enableExtraPadding: 1 checkPaddingRequired: 0 m_isRichText: 1 + m_EmojiFallbackSupport: 1 m_parseCtrlCharacters: 1 m_isOrthographic: 1 m_isCullingEnabled: 0 @@ -2877,15 +3085,17 @@ MonoBehaviour: m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 - m_enableWordWrapping: 1 + m_TextWrappingMode: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 m_linkedTextComponent: {fileID: 0} parentLinkedComponent: {fileID: 0} m_enableKerning: 1 + m_ActiveFontFeatures: 00000000 m_enableExtraPadding: 0 checkPaddingRequired: 0 m_isRichText: 1 + m_EmojiFallbackSupport: 1 m_parseCtrlCharacters: 1 m_isOrthographic: 1 m_isCullingEnabled: 0 @@ -3077,15 +3287,17 @@ MonoBehaviour: m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 - m_enableWordWrapping: 1 + m_TextWrappingMode: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 m_linkedTextComponent: {fileID: 0} parentLinkedComponent: {fileID: 0} m_enableKerning: 1 + m_ActiveFontFeatures: 6e72656b m_enableExtraPadding: 0 checkPaddingRequired: 0 m_isRichText: 1 + m_EmojiFallbackSupport: 1 m_parseCtrlCharacters: 1 m_isOrthographic: 1 m_isCullingEnabled: 0 @@ -3103,6 +3315,82 @@ MonoBehaviour: m_hasFontAssetChanged: 0 m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &4995124089024431071 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1413684294393245803} + - component: {fileID: 8910950662718486651} + - component: {fileID: 4535217986031248359} + m_Layer: 5 + m_Name: Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1413684294393245803 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4995124089024431071} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 7705100515510622073} + m_Father: {fileID: 8845940529613449592} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 35, y: -35} + m_SizeDelta: {x: 70, y: 70} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &8910950662718486651 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4995124089024431071} + m_CullTransparentMesh: 1 +--- !u!114 &4535217986031248359 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4995124089024431071} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 --- !u!1 &5215745922153047642 GameObject: m_ObjectHideFlags: 0 @@ -3469,15 +3757,17 @@ MonoBehaviour: m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 - m_enableWordWrapping: 0 + m_TextWrappingMode: 0 m_wordWrappingRatios: 0.4 m_overflowMode: 0 m_linkedTextComponent: {fileID: 0} parentLinkedComponent: {fileID: 0} m_enableKerning: 1 + m_ActiveFontFeatures: 00000000 m_enableExtraPadding: 1 checkPaddingRequired: 0 m_isRichText: 1 + m_EmojiFallbackSupport: 1 m_parseCtrlCharacters: 1 m_isOrthographic: 1 m_isCullingEnabled: 0 @@ -3623,15 +3913,17 @@ MonoBehaviour: m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 - m_enableWordWrapping: 1 + m_TextWrappingMode: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 m_linkedTextComponent: {fileID: 0} parentLinkedComponent: {fileID: 0} m_enableKerning: 1 + m_ActiveFontFeatures: 6e72656b m_enableExtraPadding: 0 checkPaddingRequired: 0 m_isRichText: 1 + m_EmojiFallbackSupport: 1 m_parseCtrlCharacters: 1 m_isOrthographic: 1 m_isCullingEnabled: 0 @@ -3810,15 +4102,17 @@ MonoBehaviour: m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 - m_enableWordWrapping: 1 + m_TextWrappingMode: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 m_linkedTextComponent: {fileID: 0} parentLinkedComponent: {fileID: 0} m_enableKerning: 1 + m_ActiveFontFeatures: 6e72656b m_enableExtraPadding: 0 checkPaddingRequired: 0 m_isRichText: 1 + m_EmojiFallbackSupport: 1 m_parseCtrlCharacters: 1 m_isOrthographic: 1 m_isCullingEnabled: 0 @@ -3964,15 +4258,17 @@ MonoBehaviour: m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 - m_enableWordWrapping: 1 + m_TextWrappingMode: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 m_linkedTextComponent: {fileID: 0} parentLinkedComponent: {fileID: 0} m_enableKerning: 1 + m_ActiveFontFeatures: 6e72656b m_enableExtraPadding: 0 checkPaddingRequired: 0 m_isRichText: 1 + m_EmojiFallbackSupport: 1 m_parseCtrlCharacters: 1 m_isOrthographic: 1 m_isCullingEnabled: 0 @@ -4100,6 +4396,7 @@ MonoBehaviour: _manipulatorList: {fileID: 7994738088484906322} _manipulatorConnectionPanelPrefab: {fileID: 8830734852478451222, guid: 19384593a545a404bbe8bd298659df46, type: 3} _copilotToggle: {fileID: 6762999849811435235} + _newUI: {fileID: 0} --- !u!114 &7858764217905313557 MonoBehaviour: m_ObjectHideFlags: 0 @@ -4687,10 +4984,13 @@ MonoBehaviour: m_GlobalFontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_OnFocusSelectAll: 1 m_ResetOnDeActivation: 1 + m_KeepTextSelectionVisible: 0 m_RestoreOriginalTextOnEscape: 1 m_isRichTextEditingAllowed: 0 m_LineLimit: 0 + isAlert: 0 m_InputValidator: {fileID: 0} + m_ShouldActivateOnSelect: 1 --- !u!114 &1396068235941189040 MonoBehaviour: m_ObjectHideFlags: 0 @@ -4822,6 +5122,81 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: -20, y: -20} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &7433329005476433894 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7705100515510622073} + - component: {fileID: 6149355962223717145} + - component: {fileID: 2815442997694183097} + m_Layer: 5 + m_Name: Checkmark + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &7705100515510622073 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7433329005476433894} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1413684294393245803} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 70, y: 70} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &6149355962223717145 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7433329005476433894} + m_CullTransparentMesh: 1 +--- !u!114 &2815442997694183097 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7433329005476433894} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10901, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 --- !u!1 &7614803770262254004 GameObject: m_ObjectHideFlags: 0 @@ -5070,10 +5445,13 @@ MonoBehaviour: m_GlobalFontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_OnFocusSelectAll: 1 m_ResetOnDeActivation: 1 + m_KeepTextSelectionVisible: 0 m_RestoreOriginalTextOnEscape: 1 m_isRichTextEditingAllowed: 0 m_LineLimit: 0 + isAlert: 0 m_InputValidator: {fileID: 0} + m_ShouldActivateOnSelect: 1 --- !u!114 &2877251926172932917 MonoBehaviour: m_ObjectHideFlags: 0 @@ -5319,15 +5697,17 @@ MonoBehaviour: m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 - m_enableWordWrapping: 0 + m_TextWrappingMode: 0 m_wordWrappingRatios: 0.4 m_overflowMode: 0 m_linkedTextComponent: {fileID: 0} parentLinkedComponent: {fileID: 0} m_enableKerning: 1 + m_ActiveFontFeatures: 00000000 m_enableExtraPadding: 1 checkPaddingRequired: 0 m_isRichText: 1 + m_EmojiFallbackSupport: 1 m_parseCtrlCharacters: 1 m_isOrthographic: 1 m_isCullingEnabled: 0 @@ -5606,15 +5986,17 @@ MonoBehaviour: m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 - m_enableWordWrapping: 1 + m_TextWrappingMode: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 m_linkedTextComponent: {fileID: 0} parentLinkedComponent: {fileID: 0} m_enableKerning: 1 + m_ActiveFontFeatures: 6e72656b m_enableExtraPadding: 0 checkPaddingRequired: 0 m_isRichText: 1 + m_EmojiFallbackSupport: 1 m_parseCtrlCharacters: 1 m_isOrthographic: 1 m_isCullingEnabled: 0 diff --git a/Assets/Prefabs/UI/UI.prefab b/Assets/Prefabs/UI/UI.prefab new file mode 100644 index 00000000..5fd32b7f --- /dev/null +++ b/Assets/Prefabs/UI/UI.prefab @@ -0,0 +1,98 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &952126553420751687 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 15652614861718102} + - component: {fileID: 6646602896389307525} + - component: {fileID: 3182672479199375693} + - component: {fileID: 6240793296398976258} + - component: {fileID: 752876678720530196} + m_Layer: 5 + m_Name: UI + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &15652614861718102 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 952126553420751687} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &6646602896389307525 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 952126553420751687} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 19102, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_PanelSettings: {fileID: 11400000, guid: 6471a2a110aba664faa84353fc94dae5, type: 2} + m_ParentUI: {fileID: 0} + sourceAsset: {fileID: 9197481963319205126, guid: 2f07f202fef6a2249838c0b722a6739b, type: 3} + m_SortingOrder: 0 + m_WorldSpaceSizeMode: 1 + m_WorldSpaceWidth: 1920 + m_WorldSpaceHeight: 1080 +--- !u!114 &3182672479199375693 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 952126553420751687} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7096bdaf70d738048bb326a49b961347, type: 3} + m_Name: + m_EditorClassIdentifier: + _state: {fileID: 11400000, guid: 1f3a268d723c7fe4f90bd218f72aa27d, type: 2} + _uiDocument: {fileID: 6646602896389307525} +--- !u!114 &6240793296398976258 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 952126553420751687} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f7c4c21d250a58a4c948c37d132330c7, type: 3} + m_Name: + m_EditorClassIdentifier: + _state: {fileID: 11400000, guid: d2fb6ddc884d6094f9a210b3dc6cbbf0, type: 2} + _uiDocument: {fileID: 6646602896389307525} +--- !u!114 &752876678720530196 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 952126553420751687} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 369f687fd323c5d458b99fe1ccb86206, type: 3} + m_Name: + m_EditorClassIdentifier: + _state: {fileID: 11400000, guid: 7dbcc18622f05be439cc292c3f7999fa, type: 2} + _uiDocument: {fileID: 6646602896389307525} diff --git a/Assets/Prefabs/UI/UI.prefab.meta b/Assets/Prefabs/UI/UI.prefab.meta new file mode 100644 index 00000000..d0d09481 --- /dev/null +++ b/Assets/Prefabs/UI/UI.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 81a48f20abaa4fa4fab0a4cb7a3ddd41 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/TrajectoryPlanner.unity b/Assets/Scenes/TrajectoryPlanner.unity index 0f5a65d9..b7dff12f 100644 --- a/Assets/Scenes/TrajectoryPlanner.unity +++ b/Assets/Scenes/TrajectoryPlanner.unity @@ -13,7 +13,7 @@ OcclusionCullingSettings: --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 9 + serializedVersion: 10 m_Fog: 0 m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 @@ -38,13 +38,12 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.44824904, g: 0.49827605, b: 0.5755831, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 12 - m_GIWorkflowMode: 1 + serializedVersion: 13 + m_BakeOnSceneLoad: 0 m_GISettings: serializedVersion: 2 m_BounceScale: 1 @@ -67,9 +66,6 @@ LightmapSettings: m_LightmapParameters: {fileID: 0} m_LightmapsBakeMode: 1 m_TextureCompression: 1 - m_FinalGather: 0 - m_FinalGatherFiltering: 1 - m_FinalGatherRayCount: 256 m_ReflectionCompression: 2 m_MixedBakeMode: 2 m_BakeBackend: 1 @@ -342,15 +338,17 @@ MonoBehaviour: m_lineSpacingMax: 0 m_paragraphSpacing: 0 m_charWidthMaxAdj: 0 - m_enableWordWrapping: 1 + m_TextWrappingMode: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 m_linkedTextComponent: {fileID: 0} parentLinkedComponent: {fileID: 0} m_enableKerning: 1 + m_ActiveFontFeatures: 00000000 m_enableExtraPadding: 0 checkPaddingRequired: 0 m_isRichText: 1 + m_EmojiFallbackSupport: 1 m_parseCtrlCharacters: 1 m_isOrthographic: 1 m_isCullingEnabled: 0 @@ -786,6 +784,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 5304039299580470460, guid: ee09154d7a7870a419882ff36080d765, type: 3} + propertyPath: _buildVersion + value: 1.5 + objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] @@ -1026,9 +1028,8 @@ Light: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 745816212} m_Enabled: 1 - serializedVersion: 10 + serializedVersion: 11 m_Type: 1 - m_Shape: 0 m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} m_Intensity: 1 m_Range: 10 @@ -1078,8 +1079,12 @@ Light: m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} m_UseBoundingSphereOverride: 0 m_UseViewFrustumForShadowCasterCull: 1 + m_ForceVisible: 0 m_ShadowRadius: 0 m_ShadowAngle: 0 + m_LightUnit: 1 + m_LuxAtDistance: 1 + m_EnableSpotReflector: 1 --- !u!4 &745816214 Transform: m_ObjectHideFlags: 0 @@ -1365,7 +1370,7 @@ PrefabInstance: m_TransformParent: {fileID: 0} m_Modifications: - target: {fileID: 2480836680909240781, guid: 6d02a754f544b65479102fc55b4a6105, type: 3} - propertyPath: m_Materials.Array.data[0] + propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 44832adf106072c4980aac75dd5d60cb, type: 2} - target: {fileID: 2480836680909240781, guid: 6d02a754f544b65479102fc55b4a6105, type: 3} @@ -1445,7 +1450,7 @@ PrefabInstance: value: 0.05 objectReference: {fileID: 0} - target: {fileID: 7017486998538583892, guid: 6d02a754f544b65479102fc55b4a6105, type: 3} - propertyPath: m_Materials.Array.data[0] + propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 3ddd4c24f5b89054eac597f10d86eabd, type: 2} - target: {fileID: 7017486998538583892, guid: 6d02a754f544b65479102fc55b4a6105, type: 3} @@ -1701,7 +1706,8 @@ Material: m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} - disabledShaderPasses: [] + disabledShaderPasses: + - MOTIONVECTORS m_LockedProperties: m_SavedProperties: serializedVersion: 3 @@ -1825,6 +1831,7 @@ Material: - _UpDirection: {r: 0, g: 1, b: 0, a: 0} - _VolumeSize: {r: 528, g: 320, b: 456, a: 0} m_BuildTextureStacks: [] + m_AllowLocking: 1 --- !u!114 &1377288554 stripped MonoBehaviour: m_CorrespondingSourceObject: {fileID: 341190944644698638, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} @@ -1945,11 +1952,11 @@ PrefabInstance: value: objectReference: {fileID: 1835840601} - target: {fileID: 7375321954526526105, guid: cfe4069a636d24749b8858eb289cac65, type: 3} - propertyPath: _focusableInputs.Array.data[0] + propertyPath: '_focusableInputs.Array.data[0]' value: objectReference: {fileID: 434432043} - target: {fileID: 7375321954526526105, guid: cfe4069a636d24749b8858eb289cac65, type: 3} - propertyPath: _focusableInputs.Array.data[1] + propertyPath: '_focusableInputs.Array.data[1]' value: objectReference: {fileID: 444598638} - target: {fileID: 7375321954526526105, guid: cfe4069a636d24749b8858eb289cac65, type: 3} @@ -2835,6 +2842,10 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: + - target: {fileID: 52129431122917559, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: _newUI + value: + objectReference: {fileID: 2439981618345730370} - target: {fileID: 52129431122917559, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} propertyPath: _destroyProbeEvent.m_PersistentCalls.m_Calls.Array.size value: 1 @@ -2976,15 +2987,15 @@ PrefabInstance: value: 3 objectReference: {fileID: 0} - target: {fileID: 341190943640726972, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: _webglDisabledFeaturesGOs.Array.data[0] + propertyPath: '_webglDisabledFeaturesGOs.Array.data[0]' value: objectReference: {fileID: 201768568} - target: {fileID: 341190943640726972, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: _webglDisabledFeaturesGOs.Array.data[1] + propertyPath: '_webglDisabledFeaturesGOs.Array.data[1]' value: objectReference: {fileID: 881322448} - target: {fileID: 341190943640726972, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: _webglDisabledFeaturesGOs.Array.data[2] + propertyPath: '_webglDisabledFeaturesGOs.Array.data[2]' value: objectReference: {fileID: 1044063713} - target: {fileID: 341190943674669911, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} @@ -2995,6 +3006,14 @@ PrefabInstance: propertyPath: m_AnchorMin.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 341190943674669911, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 341190943674669911, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 341190943674669911, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} propertyPath: m_AnchoredPosition.x value: 0 @@ -3079,6 +3098,10 @@ PrefabInstance: propertyPath: m_AnchorMin.y value: 1 objectReference: {fileID: 0} + - target: {fileID: 341190943836035196, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} - target: {fileID: 341190943836035196, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} propertyPath: m_AnchoredPosition.x value: 169.88 @@ -3223,6 +3246,14 @@ PrefabInstance: propertyPath: m_AnchorMin.y value: 1 objectReference: {fileID: 0} + - target: {fileID: 341190944034978748, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 341190944034978748, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 341190944034978748, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} propertyPath: m_AnchoredPosition.x value: 354.84 @@ -3435,6 +3466,14 @@ PrefabInstance: propertyPath: m_SizeDelta.x value: 0 objectReference: {fileID: 0} + - target: {fileID: 341190944298537966, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 341190944298537966, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 341190944298537966, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} propertyPath: m_AnchoredPosition.x value: 0 @@ -3451,6 +3490,10 @@ PrefabInstance: propertyPath: m_AnchorMin.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 341190944311329756, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} - target: {fileID: 341190944311329756, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} propertyPath: m_AnchoredPosition.x value: 0 @@ -3515,6 +3558,14 @@ PrefabInstance: propertyPath: m_AnchorMin.y value: 1 objectReference: {fileID: 0} + - target: {fileID: 341190944410943211, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 341190944410943211, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 341190944410943211, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} propertyPath: m_AnchoredPosition.x value: 384.91998 @@ -3531,6 +3582,14 @@ PrefabInstance: propertyPath: m_AnchorMin.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 341190944411999430, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 341190944411999430, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 341190944411999430, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} propertyPath: m_AnchoredPosition.y value: 0 @@ -3600,7 +3659,7 @@ PrefabInstance: value: PinpointAtlasManager, trajectoryplanner.core objectReference: {fileID: 0} - target: {fileID: 341190944529771625, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: m_Materials.Array.data[0] + propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 1375602521} - target: {fileID: 341190944541019319, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} @@ -3643,6 +3702,14 @@ PrefabInstance: propertyPath: m_SizeDelta.x value: 0 objectReference: {fileID: 0} + - target: {fileID: 341190944544068803, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 341190944544068803, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 341190944544068803, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} propertyPath: m_AnchoredPosition.x value: 0 @@ -3707,6 +3774,14 @@ PrefabInstance: propertyPath: m_SizeDelta.x value: 0 objectReference: {fileID: 0} + - target: {fileID: 341190944702461357, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 341190944702461357, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 341190944702461357, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} propertyPath: m_AnchoredPosition.x value: 0 @@ -3871,6 +3946,14 @@ PrefabInstance: propertyPath: m_AnchorMin.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 341190945105275010, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 341190945105275010, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 341190945105275010, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} propertyPath: m_AnchoredPosition.y value: 0 @@ -4099,6 +4182,10 @@ PrefabInstance: propertyPath: onValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_Target value: objectReference: {fileID: 1703646459} + - target: {fileID: 341190945403315011, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} - target: {fileID: 341190945403315022, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} propertyPath: m_RaycastTarget value: 0 @@ -4176,11 +4263,11 @@ PrefabInstance: value: 2 objectReference: {fileID: 0} - target: {fileID: 341190945559892368, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: _skullList.Array.data[0] + propertyPath: '_skullList.Array.data[0]' value: objectReference: {fileID: 1826524689} - target: {fileID: 341190945559892368, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: _skullList.Array.data[1] + propertyPath: '_skullList.Array.data[1]' value: objectReference: {fileID: 0} - target: {fileID: 341190945559892372, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} @@ -5436,15 +5523,15 @@ PrefabInstance: value: 3 objectReference: {fileID: 0} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: _whiteUIText.Array.data[0] + propertyPath: '_whiteUIText.Array.data[0]' value: objectReference: {fileID: 871760447} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: _whiteUIText.Array.data[1] + propertyPath: '_whiteUIText.Array.data[1]' value: objectReference: {fileID: 267608534} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: _whiteUIText.Array.data[2] + propertyPath: '_whiteUIText.Array.data[2]' value: objectReference: {fileID: 382584097} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} @@ -5456,11 +5543,11 @@ PrefabInstance: value: 3 objectReference: {fileID: 0} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: EditorFocusableGOs.Array.data[0] + propertyPath: 'EditorFocusableGOs.Array.data[0]' value: objectReference: {fileID: 1445793942} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: EditorFocusableGOs.Array.data[1] + propertyPath: 'EditorFocusableGOs.Array.data[1]' value: objectReference: {fileID: 76833136} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} @@ -5468,15 +5555,15 @@ PrefabInstance: value: objectReference: {fileID: 1696303671} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: _editorFocusableGOs.Array.data[0] + propertyPath: '_editorFocusableGOs.Array.data[0]' value: objectReference: {fileID: 1445793942} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: _editorFocusableGOs.Array.data[1] + propertyPath: '_editorFocusableGOs.Array.data[1]' value: objectReference: {fileID: 76833136} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: _editorFocusableGOs.Array.data[2] + propertyPath: '_editorFocusableGOs.Array.data[2]' value: objectReference: {fileID: 94756719} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} @@ -5484,107 +5571,107 @@ PrefabInstance: value: 12 objectReference: {fileID: 0} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: EditorFocusableInputs.Array.data[0] + propertyPath: 'EditorFocusableInputs.Array.data[0]' value: objectReference: {fileID: 1047957689} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: EditorFocusableInputs.Array.data[1] + propertyPath: 'EditorFocusableInputs.Array.data[1]' value: objectReference: {fileID: 1364222952} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: EditorFocusableInputs.Array.data[2] + propertyPath: 'EditorFocusableInputs.Array.data[2]' value: objectReference: {fileID: 1073378868} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: EditorFocusableInputs.Array.data[3] + propertyPath: 'EditorFocusableInputs.Array.data[3]' value: objectReference: {fileID: 160775271} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: EditorFocusableInputs.Array.data[4] + propertyPath: 'EditorFocusableInputs.Array.data[4]' value: objectReference: {fileID: 1889336854} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: EditorFocusableInputs.Array.data[5] + propertyPath: 'EditorFocusableInputs.Array.data[5]' value: objectReference: {fileID: 1805012647} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: EditorFocusableInputs.Array.data[6] + propertyPath: 'EditorFocusableInputs.Array.data[6]' value: objectReference: {fileID: 1049341881} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: EditorFocusableInputs.Array.data[7] + propertyPath: 'EditorFocusableInputs.Array.data[7]' value: objectReference: {fileID: 661010683} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: EditorFocusableInputs.Array.data[8] + propertyPath: 'EditorFocusableInputs.Array.data[8]' value: objectReference: {fileID: 434432043} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: EditorFocusableInputs.Array.data[9] + propertyPath: 'EditorFocusableInputs.Array.data[9]' value: objectReference: {fileID: 444598638} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: _editorFocusableInputs.Array.data[0] + propertyPath: '_editorFocusableInputs.Array.data[0]' value: objectReference: {fileID: 1047957689} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: _editorFocusableInputs.Array.data[1] + propertyPath: '_editorFocusableInputs.Array.data[1]' value: objectReference: {fileID: 1364222952} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: _editorFocusableInputs.Array.data[2] + propertyPath: '_editorFocusableInputs.Array.data[2]' value: objectReference: {fileID: 1073378868} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: _editorFocusableInputs.Array.data[3] + propertyPath: '_editorFocusableInputs.Array.data[3]' value: objectReference: {fileID: 160775271} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: _editorFocusableInputs.Array.data[4] + propertyPath: '_editorFocusableInputs.Array.data[4]' value: objectReference: {fileID: 1889336854} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: _editorFocusableInputs.Array.data[5] + propertyPath: '_editorFocusableInputs.Array.data[5]' value: objectReference: {fileID: 1805012647} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: _editorFocusableInputs.Array.data[6] + propertyPath: '_editorFocusableInputs.Array.data[6]' value: objectReference: {fileID: 1049341881} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: _editorFocusableInputs.Array.data[7] + propertyPath: '_editorFocusableInputs.Array.data[7]' value: objectReference: {fileID: 661010683} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: _editorFocusableInputs.Array.data[8] + propertyPath: '_editorFocusableInputs.Array.data[8]' value: objectReference: {fileID: 434432043} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: _editorFocusableInputs.Array.data[9] + propertyPath: '_editorFocusableInputs.Array.data[9]' value: objectReference: {fileID: 444598638} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: _editorFocusableInputs.Array.data[10] + propertyPath: '_editorFocusableInputs.Array.data[10]' value: objectReference: {fileID: 604468498} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: _editorFocusableInputs.Array.data[11] + propertyPath: '_editorFocusableInputs.Array.data[11]' value: objectReference: {fileID: 1450061016} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: _editorFocusableInputs.Array.data[12] + propertyPath: '_editorFocusableInputs.Array.data[12]' value: objectReference: {fileID: 604468498} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: _editorFocusableInputs.Array.data[13] + propertyPath: '_editorFocusableInputs.Array.data[13]' value: objectReference: {fileID: 604468498} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: _editorFocusableInputs.Array.data[14] + propertyPath: '_editorFocusableInputs.Array.data[14]' value: objectReference: {fileID: 604468498} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: _editorFocusableInputs.Array.data[15] + propertyPath: '_editorFocusableInputs.Array.data[15]' value: objectReference: {fileID: 604468498} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} @@ -5592,7 +5679,7 @@ PrefabInstance: value: 1 objectReference: {fileID: 0} - target: {fileID: 3336044886673126097, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} - propertyPath: _editorFocusableInputFields.Array.data[0] + propertyPath: '_editorFocusableInputFields.Array.data[0]' value: objectReference: {fileID: 0} - target: {fileID: 3444711362033518062, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} @@ -7335,6 +7422,14 @@ PrefabInstance: propertyPath: m_SizeDelta.x value: 0 objectReference: {fileID: 0} + - target: {fileID: 7136927735706924113, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7136927735706924113, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 7136927735706924113, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} propertyPath: m_AnchoredPosition.x value: 0 @@ -8239,6 +8334,10 @@ PrefabInstance: propertyPath: m_AnchorMin.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 9068794099353245877, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 9068794099353245877, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} propertyPath: m_AnchoredPosition.x value: 0 @@ -8255,6 +8354,14 @@ PrefabInstance: propertyPath: m_AnchorMin.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 9068794099390589346, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9068794099390589346, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 9068794099390589346, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} propertyPath: m_AnchoredPosition.x value: 0 @@ -8271,6 +8378,14 @@ PrefabInstance: propertyPath: m_AnchorMin.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 9068794099503478681, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9068794099503478681, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 9068794099503478681, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} propertyPath: m_AnchoredPosition.x value: 0 @@ -8287,6 +8402,14 @@ PrefabInstance: propertyPath: m_AnchorMin.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 9068794099879238884, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 9068794099879238884, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 9068794099879238884, guid: 94cdeca105038d74ea47b57e6b99eb4e, type: 3} propertyPath: m_AnchoredPosition.x value: 0 @@ -8554,7 +8677,7 @@ PrefabInstance: value: 8 objectReference: {fileID: 0} - target: {fileID: 1302158968669684560, guid: 734f6254569c01842b9d2e2ff1b1d7ae, type: 3} - propertyPath: rigGOs.Array.data[7] + propertyPath: 'rigGOs.Array.data[7]' value: objectReference: {fileID: 0} - target: {fileID: 1302158968669684561, guid: 734f6254569c01842b9d2e2ff1b1d7ae, type: 3} @@ -8674,11 +8797,11 @@ PrefabInstance: value: 5 objectReference: {fileID: 0} - target: {fileID: 2367291489059947454, guid: 734f6254569c01842b9d2e2ff1b1d7ae, type: 3} - propertyPath: _allowedProbeTypes.Array.data[3] + propertyPath: '_allowedProbeTypes.Array.data[3]' value: 24 objectReference: {fileID: 0} - target: {fileID: 2367291489059947454, guid: 734f6254569c01842b9d2e2ff1b1d7ae, type: 3} - propertyPath: _allowedProbeTypes.Array.data[4] + propertyPath: '_allowedProbeTypes.Array.data[4]' value: 24 objectReference: {fileID: 0} - target: {fileID: 2367291489059947454, guid: 734f6254569c01842b9d2e2ff1b1d7ae, type: 3} @@ -8686,55 +8809,55 @@ PrefabInstance: value: 11 objectReference: {fileID: 0} - target: {fileID: 2367291489059947454, guid: 734f6254569c01842b9d2e2ff1b1d7ae, type: 3} - propertyPath: _selectionLayerNames.Array.data[1] + propertyPath: '_selectionLayerNames.Array.data[1]' value: bank0 objectReference: {fileID: 0} - target: {fileID: 2367291489059947454, guid: 734f6254569c01842b9d2e2ff1b1d7ae, type: 3} - propertyPath: _selectionLayerNames.Array.data[2] + propertyPath: '_selectionLayerNames.Array.data[2]' value: double_length objectReference: {fileID: 0} - target: {fileID: 2367291489059947454, guid: 734f6254569c01842b9d2e2ff1b1d7ae, type: 3} - propertyPath: _selectionLayerNames.Array.data[3] + propertyPath: '_selectionLayerNames.Array.data[3]' value: default objectReference: {fileID: 0} - target: {fileID: 2367291489059947454, guid: 734f6254569c01842b9d2e2ff1b1d7ae, type: 3} - propertyPath: _selectionLayerNames.Array.data[4] + propertyPath: '_selectionLayerNames.Array.data[4]' value: bottom_row objectReference: {fileID: 0} - target: {fileID: 2367291489059947454, guid: 734f6254569c01842b9d2e2ff1b1d7ae, type: 3} - propertyPath: _channelMapProbeTypes.Array.data[1] + propertyPath: '_channelMapProbeTypes.Array.data[1]' value: 21 objectReference: {fileID: 0} - target: {fileID: 2367291489059947454, guid: 734f6254569c01842b9d2e2ff1b1d7ae, type: 3} - propertyPath: _channelMapProbeTypes.Array.data[2] + propertyPath: '_channelMapProbeTypes.Array.data[2]' value: 24 objectReference: {fileID: 0} - target: {fileID: 2367291489059947454, guid: 734f6254569c01842b9d2e2ff1b1d7ae, type: 3} - propertyPath: _channelMapProbeTypes.Array.data[3] + propertyPath: '_channelMapProbeTypes.Array.data[3]' value: 28 objectReference: {fileID: 0} - target: {fileID: 2367291489059947454, guid: 734f6254569c01842b9d2e2ff1b1d7ae, type: 3} - propertyPath: _channelMapProbeTypes.Array.data[4] + propertyPath: '_channelMapProbeTypes.Array.data[4]' value: 128 objectReference: {fileID: 0} - target: {fileID: 2367291489059947454, guid: 734f6254569c01842b9d2e2ff1b1d7ae, type: 3} - propertyPath: _channelMapProbeTypes.Array.data[5] + propertyPath: '_channelMapProbeTypes.Array.data[5]' value: 256 objectReference: {fileID: 0} - target: {fileID: 2367291489059947454, guid: 734f6254569c01842b9d2e2ff1b1d7ae, type: 3} - propertyPath: _channelMapProbeTypes.Array.data[6] + propertyPath: '_channelMapProbeTypes.Array.data[6]' value: -1 objectReference: {fileID: 0} - target: {fileID: 2367291489059947454, guid: 734f6254569c01842b9d2e2ff1b1d7ae, type: 3} - propertyPath: _channelMapProbeTypes.Array.data[7] + propertyPath: '_channelMapProbeTypes.Array.data[7]' value: 25 objectReference: {fileID: 0} - target: {fileID: 2367291489059947454, guid: 734f6254569c01842b9d2e2ff1b1d7ae, type: 3} - propertyPath: _channelMapProbeTypes.Array.data[8] + propertyPath: '_channelMapProbeTypes.Array.data[8]' value: 50 objectReference: {fileID: 0} - target: {fileID: 2367291489059947454, guid: 734f6254569c01842b9d2e2ff1b1d7ae, type: 3} - propertyPath: _channelMapProbeTypes.Array.data[9] + propertyPath: '_channelMapProbeTypes.Array.data[9]' value: 100 objectReference: {fileID: 0} - target: {fileID: 2367291489059947454, guid: 734f6254569c01842b9d2e2ff1b1d7ae, type: 3} @@ -8742,7 +8865,7 @@ PrefabInstance: value: 5 objectReference: {fileID: 0} - target: {fileID: 2367291489059947454, guid: 734f6254569c01842b9d2e2ff1b1d7ae, type: 3} - propertyPath: _channelMapProbeTypes.Array.data[10] + propertyPath: '_channelMapProbeTypes.Array.data[10]' value: 200 objectReference: {fileID: 0} - target: {fileID: 2367291489059947454, guid: 734f6254569c01842b9d2e2ff1b1d7ae, type: 3} @@ -8871,6 +8994,72 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!1001 &2439981618345730369 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 15652614861718102, guid: 81a48f20abaa4fa4fab0a4cb7a3ddd41, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 15652614861718102, guid: 81a48f20abaa4fa4fab0a4cb7a3ddd41, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 15652614861718102, guid: 81a48f20abaa4fa4fab0a4cb7a3ddd41, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 15652614861718102, guid: 81a48f20abaa4fa4fab0a4cb7a3ddd41, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 15652614861718102, guid: 81a48f20abaa4fa4fab0a4cb7a3ddd41, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 15652614861718102, guid: 81a48f20abaa4fa4fab0a4cb7a3ddd41, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 15652614861718102, guid: 81a48f20abaa4fa4fab0a4cb7a3ddd41, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 15652614861718102, guid: 81a48f20abaa4fa4fab0a4cb7a3ddd41, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 15652614861718102, guid: 81a48f20abaa4fa4fab0a4cb7a3ddd41, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 15652614861718102, guid: 81a48f20abaa4fa4fab0a4cb7a3ddd41, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 952126553420751687, guid: 81a48f20abaa4fa4fab0a4cb7a3ddd41, type: 3} + propertyPath: m_Name + value: UI + objectReference: {fileID: 0} + - target: {fileID: 952126553420751687, guid: 81a48f20abaa4fa4fab0a4cb7a3ddd41, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 81a48f20abaa4fa4fab0a4cb7a3ddd41, type: 3} +--- !u!1 &2439981618345730370 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 952126553420751687, guid: 81a48f20abaa4fa4fab0a4cb7a3ddd41, type: 3} + m_PrefabInstance: {fileID: 2439981618345730369} + m_PrefabAsset: {fileID: 0} --- !u!1001 &4661864818121820327 PrefabInstance: m_ObjectHideFlags: 0 @@ -8986,7 +9175,7 @@ PrefabInstance: value: 0 objectReference: {fileID: 0} - target: {fileID: 6193778550765170453, guid: b578609b502e9c74286332dd7db2cfc8, type: 3} - propertyPath: m_Materials.Array.data[0] + propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 0c293f080f6c91d4489c6ddc14f326ec, type: 2} - target: {fileID: 6193778550765170455, guid: b578609b502e9c74286332dd7db2cfc8, type: 3} @@ -9066,7 +9255,7 @@ PrefabInstance: value: 0 objectReference: {fileID: 0} - target: {fileID: 6193778552155365646, guid: b578609b502e9c74286332dd7db2cfc8, type: 3} - propertyPath: m_Materials.Array.data[0] + propertyPath: 'm_Materials.Array.data[0]' value: objectReference: {fileID: 2100000, guid: 9e04d79f7c3c3534a9031f28643d20c1, type: 2} m_RemovedComponents: [] @@ -10551,7 +10740,7 @@ PrefabInstance: value: 2 objectReference: {fileID: 0} - target: {fileID: 8016510558008620341, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3} - propertyPath: brainRegionMaterials.Array.data[2] + propertyPath: 'brainRegionMaterials.Array.data[2]' value: objectReference: {fileID: 2100000, guid: 2a8f9060c91986e4083dd67bf487177b, type: 2} - target: {fileID: 8016510558008620341, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3} @@ -10559,7 +10748,7 @@ PrefabInstance: value: 2 objectReference: {fileID: 0} - target: {fileID: 8016510558008620341, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3} - propertyPath: brainRegionMaterialNames.Array.data[2] + propertyPath: 'brainRegionMaterialNames.Array.data[2]' value: toon-outline objectReference: {fileID: 0} - target: {fileID: 8016510558008620343, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3} @@ -10783,79 +10972,79 @@ PrefabInstance: value: 4 objectReference: {fileID: 0} - target: {fileID: 8016510558008620343, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3} - propertyPath: whiteUIText.Array.data[0] + propertyPath: 'whiteUIText.Array.data[0]' value: objectReference: {fileID: 382584097} - target: {fileID: 8016510558008620343, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3} - propertyPath: whiteUIText.Array.data[1] + propertyPath: 'whiteUIText.Array.data[1]' value: objectReference: {fileID: 871760447} - target: {fileID: 8016510558008620343, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3} - propertyPath: whiteUIText.Array.data[2] + propertyPath: 'whiteUIText.Array.data[2]' value: objectReference: {fileID: 267608534} - target: {fileID: 8016510558008620343, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3} - propertyPath: _whiteUIText.Array.data[0] + propertyPath: '_whiteUIText.Array.data[0]' value: objectReference: {fileID: 382584097} - target: {fileID: 8016510558008620343, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3} - propertyPath: _whiteUIText.Array.data[1] + propertyPath: '_whiteUIText.Array.data[1]' value: objectReference: {fileID: 871760447} - target: {fileID: 8016510558008620343, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3} - propertyPath: _whiteUIText.Array.data[2] + propertyPath: '_whiteUIText.Array.data[2]' value: objectReference: {fileID: 267608534} - target: {fileID: 8016510558008620343, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3} - propertyPath: probePrefabs.Array.data[3] + propertyPath: 'probePrefabs.Array.data[3]' value: objectReference: {fileID: 8943063119080654577, guid: 9adfbf39d76a6644d884c44a708ee70a, type: 3} - target: {fileID: 8016510558008620343, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3} - propertyPath: _probePrefabs.Array.data[3] + propertyPath: '_probePrefabs.Array.data[3]' value: objectReference: {fileID: 8943063119080654577, guid: 9adfbf39d76a6644d884c44a708ee70a, type: 3} - target: {fileID: 8016510558008620343, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3} - propertyPath: _probePrefabs.Array.data[4] + propertyPath: '_probePrefabs.Array.data[4]' value: objectReference: {fileID: 4368194536080577051, guid: 7282cbc09f6c2fa40bd5b661f02ae460, type: 3} - target: {fileID: 8016510558008620343, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3} - propertyPath: _probePrefabs.Array.data[5] + propertyPath: '_probePrefabs.Array.data[5]' value: objectReference: {fileID: 4368194536080577051, guid: c555f2ac47d6bf14b86dff1e23ec243d, type: 3} - target: {fileID: 8016510558008620343, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3} - propertyPath: _probePrefabs.Array.data[6] + propertyPath: '_probePrefabs.Array.data[6]' value: objectReference: {fileID: 4368194536080577051, guid: 6891811463e7bf8479053eb1eb1eefe9, type: 3} - target: {fileID: 8016510558008620343, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3} - propertyPath: _probePrefabs.Array.data[7] + propertyPath: '_probePrefabs.Array.data[7]' value: objectReference: {fileID: 4368194536080577051, guid: fb43e89f3ab62794a9da5def11da869c, type: 3} - target: {fileID: 8016510558008620343, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3} - propertyPath: _probePrefabs.Array.data[8] + propertyPath: '_probePrefabs.Array.data[8]' value: objectReference: {fileID: 4368194536080577051, guid: 522e9cff57601f04092f13575c3dfdbf, type: 3} - target: {fileID: 8016510558008620343, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3} - propertyPath: _probePrefabs.Array.data[9] + propertyPath: '_probePrefabs.Array.data[9]' value: objectReference: {fileID: 4368194536080577051, guid: c2478d085fb8dc949a40d0951e320e94, type: 3} - target: {fileID: 8016510558008620343, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3} - propertyPath: probePrefabIDs.Array.data[3] + propertyPath: 'probePrefabIDs.Array.data[3]' value: 8 objectReference: {fileID: 0} - target: {fileID: 8016510558008620343, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3} - propertyPath: _probePrefabIDs.Array.data[0] + propertyPath: '_probePrefabIDs.Array.data[0]' value: 0 objectReference: {fileID: 0} - target: {fileID: 8016510558008620343, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3} - propertyPath: _probePrefabIDs.Array.data[1] + propertyPath: '_probePrefabIDs.Array.data[1]' value: 21 objectReference: {fileID: 0} - target: {fileID: 8016510558008620343, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3} - propertyPath: _probePrefabIDs.Array.data[2] + propertyPath: '_probePrefabIDs.Array.data[2]' value: 24 objectReference: {fileID: 0} - target: {fileID: 8016510558008620343, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3} - propertyPath: _probePrefabIDs.Array.data[3] + propertyPath: '_probePrefabIDs.Array.data[3]' value: 28 objectReference: {fileID: 0} - target: {fileID: 8016510558008620343, guid: 482bfae3ba88b424e96d7fcd669f7b73, type: 3} @@ -11863,3 +12052,4 @@ SceneRoots: - {fileID: 608524081} - {fileID: 8634027648085377985} - {fileID: 9130107592048835190} + - {fileID: 2439981618345730369} diff --git a/Assets/Scripts/Core/Util/IsExternalInit.cs b/Assets/Scripts/Core/Util/IsExternalInit.cs new file mode 100644 index 00000000..0893f5e5 --- /dev/null +++ b/Assets/Scripts/Core/Util/IsExternalInit.cs @@ -0,0 +1,7 @@ +using System.ComponentModel; + +namespace System.Runtime.CompilerServices +{ + [EditorBrowsable(EditorBrowsableState.Never)] + public class IsExternalInit { } +} diff --git a/Assets/Scripts/Core/Util/IsExternalInit.cs.meta b/Assets/Scripts/Core/Util/IsExternalInit.cs.meta new file mode 100644 index 00000000..08f96bf0 --- /dev/null +++ b/Assets/Scripts/Core/Util/IsExternalInit.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c889421ec241fbf448a0105d64279cea \ No newline at end of file diff --git a/Assets/Scripts/Core/Util/ResettingScriptableObject.cs b/Assets/Scripts/Core/Util/ResettingScriptableObject.cs new file mode 100644 index 00000000..fc90ac4e --- /dev/null +++ b/Assets/Scripts/Core/Util/ResettingScriptableObject.cs @@ -0,0 +1,31 @@ +using UnityEngine; +#if UNITY_EDITOR +using UnityEditor; +#endif + +namespace Core.Util +{ + public abstract class ResettingScriptableObject : ScriptableObject + { +#if UNITY_EDITOR + private string _initialJson = string.Empty; + + private void OnEnable() + { + if (Application.isPlaying) + return; + EditorApplication.playModeStateChanged -= OnPlayModeStateChanged; + EditorApplication.playModeStateChanged += OnPlayModeStateChanged; + _initialJson = EditorJsonUtility.ToJson(this); + } + + private void OnPlayModeStateChanged(PlayModeStateChange state) + { + if (state != PlayModeStateChange.ExitingPlayMode) + return; + EditorApplication.playModeStateChanged -= OnPlayModeStateChanged; + EditorJsonUtility.FromJsonOverwrite(_initialJson, this); + } +#endif + } +} diff --git a/Assets/Scripts/Core/Util/ResettingScriptableObject.cs.meta b/Assets/Scripts/Core/Util/ResettingScriptableObject.cs.meta new file mode 100644 index 00000000..6cdda06f --- /dev/null +++ b/Assets/Scripts/Core/Util/ResettingScriptableObject.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 22194e125c099d94da23503a00587831 \ No newline at end of file diff --git a/Assets/Scripts/EphysLink/CommunicationManager.cs b/Assets/Scripts/EphysLink/CommunicationManager.cs index 2cbeda3c..9792a95c 100644 --- a/Assets/Scripts/EphysLink/CommunicationManager.cs +++ b/Assets/Scripts/EphysLink/CommunicationManager.cs @@ -1,4 +1,6 @@ using System; +using System.Globalization; +using System.IO; using System.Linq; using BestHTTP.SocketIO3; using UnityEngine; @@ -339,6 +341,15 @@ private void GetVersion(Action onSuccessCallback, Action onErrorCallback .Emit("get_version"); } + /// + /// Get Ephys Link version. + /// + /// Version number. + private async Awaitable GetVersion() + { + return await EmitAndGetStringResponse("get_version", null); + } + /// /// Get the platform type. /// @@ -357,6 +368,15 @@ public void GetPlatformType(Action onSuccessCallback, Action onErrorCall .Emit("get_platform_type"); } + /// + /// Get the platform type. + /// + /// Platform type. + public async Awaitable GetPlatformType() + { + return await EmitAndGetStringResponse("get_platform_type", null); + } + /// /// Get manipulators event sender. /// @@ -387,6 +407,18 @@ public void GetManipulators( .Emit("get_manipulators"); } + /// + /// Get connected manipulators and some basic information about them. + /// + /// Manipulators and their information. + public async Awaitable GetManipulators() + { + return await EmitAndGetResponse( + "get_manipulators", + null + ); + } + /// /// Request the current position of a manipulator (mm). /// @@ -419,6 +451,19 @@ public void GetPosition( .Emit("get_position", manipulatorId); } + /// + /// Request the current position of a manipulator (mm). + /// + /// ID of the manipulator to get teh position of. + /// with manipulator's position. + public async Awaitable GetPosition(string manipulatorId) + { + return await EmitAndGetResponse( + "get_position", + manipulatorId + ); + } + /// /// Request the current angles of a manipulator. /// @@ -450,6 +495,16 @@ public void GetAngles( .Emit("get_angles", manipulatorId); } + /// + /// Request the current angles of a manipulator. + /// + /// ID of the manipulator to get the position of + /// with manipulator's angles. + public async Awaitable GetAngles(string manipulatorId) + { + return await EmitAndGetResponse("get_angles", manipulatorId); + } + public void GetShankCount( string manipulatorId, Action onSuccessCallback, @@ -475,6 +530,19 @@ public void GetShankCount( .Emit("get_shank_count", manipulatorId); } + /// + /// Request the number of shanks on a manipulator. + /// + /// ID of the manipulator to get the shank count of. + /// with the number of shanks. + public async Awaitable GetShankCount(string manipulatorId) + { + return await EmitAndGetResponse( + "get_shank_count", + manipulatorId + ); + } + /// /// Request a manipulator be moved to a specific position. /// @@ -507,6 +575,19 @@ public void SetPosition( .Emit("set_position", ToJson(request)); } + /// + /// Request a manipulator be moved to a specific position. + /// + /// Goto position request object + /// with the manipulator's new position. + public async Awaitable SetPosition(SetPositionRequest request) + { + return await EmitAndGetResponse( + "set_position", + request + ); + } + /// /// Request a manipulator drive down to a specific depth. /// @@ -538,6 +619,19 @@ Action onErrorCallback .Emit("set_depth", ToJson(request)); } + /// + /// Request a manipulator drive down to a specific depth. + /// + /// Drive to depth request + /// with the manipulator's new depth. + public async Awaitable SetDepth(SetDepthRequest request) + { + return await EmitAndGetResponse( + "set_depth", + request + ); + } + /// /// Set the inside brain state of a manipulator. /// @@ -570,7 +664,20 @@ public void SetInsideBrain( } /// - /// Request a manipulator stops moving. + /// Set the inside brain state of a manipulator. + /// + /// Set inside brain request. + /// with the manipulator's new inside brain state. + public async Awaitable SetInsideBrain(SetInsideBrainRequest request) + { + return await EmitAndGetResponse( + "set_inside_brain", + request + ); + } + + /// + /// Request a manipulator stops moving. /// /// /// @@ -585,19 +692,25 @@ Action onErrorCallback .Socket.ExpectAcknowledgement(data => { if (DataKnownAndNotEmpty(data)) - { // Non-empty response means error. onErrorCallback?.Invoke(data); - } else - { // Empty response means success. onSuccessCallback?.Invoke(); - } }) .Emit("stop", manipulatorId); } + /// + /// Request a manipulator stops moving. + /// + /// ID of the manipulator to stop + /// Empty string if successful, error message if failed. + public async Awaitable Stop(string manipulatorId) + { + return await EmitAndGetStringResponse("stop", manipulatorId); + } + /// /// Request all movement to stop. /// @@ -609,33 +722,144 @@ public void StopAll(Action onSuccessCallback, Action onErrorCallback) .Socket.ExpectAcknowledgement(data => { if (DataKnownAndNotEmpty(data)) - { // Non-empty response means error. onErrorCallback?.Invoke(data); - } else - { // Empty response means success. onSuccessCallback?.Invoke(); - } }) .Emit("stop_all"); } + /// + /// Request all manipulators to stop. + /// + /// Empty string if successful, error message if failed. + public async Awaitable StopAll() + { + return await EmitAndGetStringResponse("stop_all", null); + } + + #endregion + + #region Utility Functions + + /// + /// Quick error handler to log the error string if it exists. + /// + /// Error response to check. + /// True if there was an error, false otherwise. + public static bool HasError(string error) + { + // Shortcut exit if there was no error. + if (string.IsNullOrEmpty(error)) + return false; + + // Log the error. + Debug.LogError(error); + OutputLog.Log( + new[] + { + "ephys_link", + DateTime.Now.ToString(CultureInfo.InvariantCulture), + $"ERROR: {error}" + } + ); + + // Return true to indicate an error. + return true; + } + #endregion #region Helper functions + /// + /// Generic function to emit and event and get a response from the server. + /// + /// Event to emit to. + /// Parameter to send with the event. + /// Expected (parsed) response type. + /// Type of the request parameter. + /// Response from server. Parsed to if it's not a string. + /// Invalid response from server (empty or unknown). + private async Awaitable EmitAndGetResponse(string eventName, TR requestParameter) + { + // Query server and capture response. + var dataCompletionSource = new AwaitableCompletionSource(); + _connectionManager + .Socket.ExpectAcknowledgement(data => dataCompletionSource.SetResult(data)) + .Emit( + eventName, + typeof(TR) == typeof(string) ? requestParameter : ToJson(requestParameter) + ); + + // Wait for data. + var data = await dataCompletionSource.Awaitable; + + // Return data if it exists. Parse if return type is not string. + if (DataKnownAndNotEmpty(data)) + return ParseJson(data); + + // Throw exception if data is empty. + throw new InvalidDataException($"{eventName} invalid response: {data}"); + } + + /// + /// Emit an event and get a string response from the server. + /// + /// Event to emit to. + /// Parameter to send with the event. + /// Type of the request parameter. + /// Response from server as a string. + private async Awaitable EmitAndGetStringResponse( + string eventName, + TR requestParameter + ) + { + // Query server and capture response. + var dataCompletionSource = new AwaitableCompletionSource(); + _connectionManager + .Socket.ExpectAcknowledgement(data => dataCompletionSource.SetResult(data)) + .Emit( + eventName, + typeof(TR) == typeof(string) ? requestParameter : ToJson(requestParameter) + ); + + // Wait for data. + var data = await dataCompletionSource.Awaitable; + + // Return data. + return data; + } + + /// + /// Check if data is not empty and is not the "unkown event" error. + /// + /// Data to check. + /// True if data is not empty and not the "unkown event" error, false otherwise. private static bool DataKnownAndNotEmpty(string data) { return !string.IsNullOrEmpty(data) && !data.Equals(UNKOWN_EVENT); } + /// + /// Parse a JSON string into a data object. + /// + /// JSON string to parse. + /// Type of the data object. + /// Parsed data object. private static T ParseJson(string json) { return JsonUtility.FromJson(json); } + /// + /// Convert a data object into a JSON string. + /// + /// Data object to convert. + /// Type of the data object. + /// JSON string. private static string ToJson(T data) { return JsonUtility.ToJson(data); diff --git a/Assets/Scripts/EphysLink/EphysLinkModels.cs b/Assets/Scripts/EphysLink/EphysLinkModels.cs index 67e98139..039b30b5 100644 --- a/Assets/Scripts/EphysLink/EphysLinkModels.cs +++ b/Assets/Scripts/EphysLink/EphysLinkModels.cs @@ -125,7 +125,7 @@ public SetInsideBrainRequest(string manipulatorId, bool inside) } } -; + [Serializable] public struct SetPositionRequest { diff --git a/Assets/Scripts/EphysLink/trajectoryplanner.ephyslink.asmdef b/Assets/Scripts/EphysLink/trajectoryplanner.ephyslink.asmdef index eb38189a..2fb193cd 100644 --- a/Assets/Scripts/EphysLink/trajectoryplanner.ephyslink.asmdef +++ b/Assets/Scripts/EphysLink/trajectoryplanner.ephyslink.asmdef @@ -7,7 +7,8 @@ "vbl.brainatlas.runtime", "vbl.brainatlas.atlas", "vbl.brainatlas.coordsystems", - "vblcore.coordinates" + "vblcore.coordinates", + "trajectoryplanner.log" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Assets/Scripts/Pinpoint/Probes/Controllers/CartesianProbeController.cs b/Assets/Scripts/Pinpoint/Probes/Controllers/CartesianProbeController.cs index 7f7a9aa2..900bfc53 100644 --- a/Assets/Scripts/Pinpoint/Probes/Controllers/CartesianProbeController.cs +++ b/Assets/Scripts/Pinpoint/Probes/Controllers/CartesianProbeController.cs @@ -476,22 +476,25 @@ private void ClearClickRotate() /// /// /// - private void MoveProbe_XYZD(Vector4 direction, float speed) + private async void MoveProbe_XYZD(Vector4 direction, float speed) { - // Get the positional delta + // Get the positional delta. var posDelta = Vector4.Scale(direction * speed,UnlockedDir); if (ManipulatorManualControl) { - // Cancel if a movement is in progress + // Cancel if a movement is in progress. if (ManipulatorKeyboardMoveInProgress) return; - // Disable/ignore more input until movement is done + // Disable/ignore more input until movement is done. ManipulatorKeyboardMoveInProgress = true; - // Call movement and re-enable input when done - ProbeManager.ManipulatorBehaviorController.MoveByWorldSpaceDelta(posDelta, - _ => ManipulatorKeyboardMoveInProgress = false, Debug.LogError); + // Call movement and re-enable input when done. + if (!await ProbeManager.ManipulatorBehaviorController.MoveByWorldSpaceDelta(posDelta)) + return; + + // Re-enable input. + ManipulatorKeyboardMoveInProgress = false; } else { diff --git a/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController.cs b/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController.cs deleted file mode 100644 index 694351a7..00000000 --- a/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController.cs +++ /dev/null @@ -1,511 +0,0 @@ -using System; -using System.Globalization; -using System.Linq; -using BrainAtlas; -using BrainAtlas.CoordinateSystems; -using EphysLink; -using Pinpoint.CoordinateSystems; -using UnityEngine; -using UnityEngine.Events; - -namespace Pinpoint.Probes -{ - public class ManipulatorBehaviorController : MonoBehaviour - { - #region Constants - - // Default movement speed: 0.5 mm/s - public const float AUTOMATIC_MOVEMENT_SPEED = 0.5f; - - #endregion - - #region Components - - [SerializeField] - private ProbeManager _probeManager; - - [SerializeField] - private ProbeController _probeController; - - #endregion - - #region Properties - - public string ManipulatorID { get; private set; } - - public int NumAxes { get; set; } - - public Vector3 Dimensions { get; private set; } - - /** - * Getter and setter or the zero coordinate offset of the manipulator. - * If passed a NaN value, the previous value is kept. - */ - public Vector4 ZeroCoordinateOffset - { - get => _zeroCoordinateOffset; - set - { - _zeroCoordinateOffset = new Vector4( - float.IsNaN(value.x) ? _zeroCoordinateOffset.x : value.x, - float.IsNaN(value.y) ? _zeroCoordinateOffset.y : value.y, - float.IsNaN(value.z) ? _zeroCoordinateOffset.z : value.z, - float.IsNaN(value.w) ? _zeroCoordinateOffset.w : value.w - ); - - ZeroCoordinateOffsetChangedEvent.Invoke(_zeroCoordinateOffset); - } - } - - public float BrainSurfaceOffset - { - get => _brainSurfaceOffset; - set - { - _brainSurfaceOffset = value; - BrainSurfaceOffsetChangedEvent.Invoke(_brainSurfaceOffset); - } - } - - public bool IsSetToDropToSurfaceWithDepth - { - get => _isSetToDropToSurfaceWithDepth; - set - { - if (BrainSurfaceOffset != 0) - return; - _isSetToDropToSurfaceWithDepth = value; - IsSetToDropToSurfaceWithDepthChangedEvent.Invoke(value); - } - } - - public CoordinateSpace CoordinateSpace { get; private set; } - private CoordinateTransform CoordinateTransform { get; set; } - - public bool IsRightHanded - { - get => _isRightHanded; - set - { - _isRightHanded = value; - UpdateSpaceAndTransform(); - } - } - - // Helper functions to create and destroy a probe - public Action CreatePathfinderProbe { private get; set; } - public Action DestroyThisProbe { private get; set; } - - #region Private internal fields - - private Vector4 _lastManipulatorPosition = Vector4.zero; - private Vector4 _lastLoggedManipulatorPosition = Vector4.zero; - private Vector4 _zeroCoordinateOffset = Vector4.zero; - private float _brainSurfaceOffset; - private bool _isSetToDropToSurfaceWithDepth = true; - private bool _isRightHanded; - private float _lastLoggedTime; - private bool _isSetToInsideBrain; - - #endregion - - #endregion - - #region Events - - public UnityEvent ZeroCoordinateOffsetChangedEvent; - public UnityEvent BrainSurfaceOffsetChangedEvent; - public UnityEvent IsSetToDropToSurfaceWithDepthChangedEvent; - - #endregion - - #region Unity - - /// - /// Setup this instance - /// - private void Awake() - { - // Start off as disabled - enabled = false; - - // Update manipulator inside brain state - // _probeController.MovedThisFrameEvent.AddListener(() => - // { - // if (_isSetToInsideBrain != _probeManager.IsProbeInBrain()) - // CommunicationManager.Instance.SetInsideBrain(ManipulatorID, _probeManager.IsProbeInBrain(), - // insideBrain => - // { - // _isSetToInsideBrain = insideBrain; - // _probeController.UnlockedDir = insideBrain ? new Vector4(0, 0, 0, 1) : Vector4.one; - // }); - // }); - } - - private void OnDisable() - { - ManipulatorID = null; - _zeroCoordinateOffset = Vector4.zero; - _brainSurfaceOffset = 0; - } - - #endregion - - - #region Public Methods - - public void Initialize(string manipulatorID, bool calibrated) - { - CommunicationManager.Instance.GetManipulators(response => - { - // Shortcut exit if we have an invalid manipulator ID - if (!response.Manipulators.Contains(manipulatorID)) - return; - - // Set manipulator ID, number of axes, and dimensions - ManipulatorID = manipulatorID; - NumAxes = response.NumAxes; - Dimensions = response.Dimensions; - - // Update transform and space - UpdateSpaceAndTransform(); - - // Lock the manipulator from manual control - _probeController.SetControllerLock(true); - - StartEchoing(); - return; - - void StartEchoing() - { - CommunicationManager.Instance.GetPosition( - manipulatorID, - pos => - { - if (ZeroCoordinateOffset.Equals(Vector4.zero)) - ZeroCoordinateOffset = pos; - EchoPosition(pos); - } - ); - } - }); - } - - private void UpdateSpaceAndTransform() - { - CoordinateSpace = new ManipulatorSpace(Dimensions); - CoordinateTransform = NumAxes switch - { - 4 - => IsRightHanded - ? new FourAxisRightHandedManipulatorTransform( - _probeController.Insertion.Yaw - ) - : new FourAxisLeftHandedManipulatorTransform( - _probeController.Insertion.Yaw - ), - 3 - => new ThreeAxisLeftHandedTransform( - _probeController.Insertion.Yaw, - _probeController.Insertion.Pitch - ), - _ => CoordinateTransform - }; - } - - public Vector4 ConvertInsertionAPMLDVToManipulatorPosition(Vector3 insertionAPMLDV) - { - // Convert apmldv to world coordinate - var convertToWorld = _probeManager.ProbeController.Insertion.T2World_Vector( - insertionAPMLDV - ); - - // Convert to Manipulator space - var posInManipulatorSpace = CoordinateSpace.World2Space(convertToWorld); - Vector4 posInManipulatorTransform = CoordinateTransform.U2T(posInManipulatorSpace); - - // Apply brain surface offset - var brainSurfaceAdjustment = float.IsNaN(BrainSurfaceOffset) ? 0 : BrainSurfaceOffset; - if (_probeManager.ManipulatorBehaviorController.IsSetToDropToSurfaceWithDepth) - posInManipulatorTransform.w -= brainSurfaceAdjustment; - else - posInManipulatorTransform.z += brainSurfaceAdjustment; - - // Apply coordinate offsets and return result - return posInManipulatorTransform + ZeroCoordinateOffset; - } - - /// - /// Set manipulator space offset from brain surface as Depth from manipulator or probe coordinates. - /// - public void ComputeBrainSurfaceOffset() - { - if (_probeManager.IsProbeInBrain()) - { - // Just calculate the distance from the probe tip position to the brain surface - BrainSurfaceOffset -= _probeManager.GetSurfaceCoordinateT().depthT; - } - else - { - // We need to calculate the surface coordinate ourselves - var (brainSurfaceCoordinateIdx, _) = _probeManager.CalculateEntryCoordinate( - !IsSetToDropToSurfaceWithDepth - ); - - if (float.IsNaN(brainSurfaceCoordinateIdx.x)) - { - Debug.LogError("Could not find brain surface! Canceling set brain offset."); - return; - } - - var brainSurfaceToTransformed = _probeController.Insertion.World2T( - BrainAtlasManager.ActiveReferenceAtlas.AtlasIdx2World(brainSurfaceCoordinateIdx) - ); - - BrainSurfaceOffset += Vector3.Distance( - brainSurfaceToTransformed, - _probeController.Insertion.APMLDV - ); - } - } - - /// - /// Manual adjustment of brain surface offset. - /// - /// Amount to change the brain surface offset by - public void IncrementBrainSurfaceOffset(float increment) - { - BrainSurfaceOffset += increment; - } - - /// - /// Move manipulator by a given delta in world space - /// - /// Delta (X, Y, Z, D) to move by in world space coordinates - /// Action on success - /// Action on error - public void MoveByWorldSpaceDelta( - Vector4 worldSpaceDelta, - Action onSuccessCallback, - Action onErrorCallback = null - ) - { - // Convert to manipulator axes (world -> space -> transform) - var manipulatorSpaceDelta = CoordinateSpace.World2Space_Vector(worldSpaceDelta); - var manipulatorTransformDelta = CoordinateTransform.U2T(manipulatorSpaceDelta); - var manipulatorSpaceDepth = worldSpaceDelta.w; - - print( - "World space delta: " - + worldSpaceDelta - + "; Manipulator space delta: " - + manipulatorSpaceDelta - + "; Manipulator transform delta: " - + manipulatorTransformDelta - + "; Manipulator space depth: " - + manipulatorSpaceDepth - ); - - // Get manipulator position - CommunicationManager.Instance.GetPosition( - ManipulatorID, - pos => - { - // Apply delta - var targetPosition = - pos - + new Vector4( - manipulatorTransformDelta.x, - manipulatorTransformDelta.y, - manipulatorTransformDelta.z - ); - // Move manipulator - CommunicationManager.Instance.SetPosition( - new SetPositionRequest( - ManipulatorID, - targetPosition, - AUTOMATIC_MOVEMENT_SPEED - ), - newPos => - { - print("New pos: " + newPos + "; Setting depth..."); - // Process depth movement - var targetDepth = newPos.w + manipulatorSpaceDepth; - // Move the manipulator - CommunicationManager.Instance.SetDepth( - new SetDepthRequest( - ManipulatorID, - targetDepth, - AUTOMATIC_MOVEMENT_SPEED - ), - _ => - CommunicationManager.Instance.GetPosition( - ManipulatorID, - onSuccessCallback, - onErrorCallback - ), - onErrorCallback - ); - }, - onErrorCallback - ); - } - ); - } - - /// - /// Drive the manipulator back to the zero coordinate position - /// - /// Action on success - /// Action on failure - public void MoveBackToZeroCoordinate( - Action onSuccessCallback, - Action onErrorCallBack - ) - { - // Send move command - CommunicationManager.Instance.SetPosition( - new SetPositionRequest( - ManipulatorID, - ZeroCoordinateOffset, - AUTOMATIC_MOVEMENT_SPEED - ), - onSuccessCallback, - onErrorCallBack - ); - } - - #endregion - - #region Private Methods - - private void EchoPosition(Vector4 pos) - { - // Exit if disabled and there is no probe controller. - if (!enabled && _probeController == null) - return; - - // Calculate last used direction for dropping to brain surface (between depth and DV) - var dvDelta = Math.Abs(pos.z - _lastManipulatorPosition.z); - var depthDelta = Math.Abs(pos.w - _lastManipulatorPosition.w); - if (dvDelta > 0.0001 || depthDelta > 0.0001) - IsSetToDropToSurfaceWithDepth = depthDelta > dvDelta; - _lastManipulatorPosition = pos; - - // Apply zero coordinate offset. - var zeroCoordinateAdjustedManipulatorPosition = pos - ZeroCoordinateOffset; - - // Convert to coordinate space. - var manipulatorSpacePosition = CoordinateTransform.T2U( - zeroCoordinateAdjustedManipulatorPosition - ); - - // Brain surface adjustment. - var brainSurfaceAdjustment = float.IsNaN(BrainSurfaceOffset) ? 0 : BrainSurfaceOffset; - if (IsSetToDropToSurfaceWithDepth) - { - // Apply depth adjustment to manipulator position for non-3 axis manipulators. - if (CoordinateTransform.Prefix != "3lhm") - zeroCoordinateAdjustedManipulatorPosition.w += brainSurfaceAdjustment; - } - else - { - manipulatorSpacePosition.y -= brainSurfaceAdjustment; - } - - // Convert to world space. - var zeroCoordinateAdjustedWorldPosition = CoordinateSpace.Space2World( - manipulatorSpacePosition - ); - - // Set probe position (change axes to match probe). - var transformedApmldv = BrainAtlasManager.World2T_Vector( - zeroCoordinateAdjustedWorldPosition - ); - - // Set probe position. - // For 3-axis manipulators, use depth to adjust brain offset if applying offset on depth. - if (CoordinateTransform.Prefix == "3lhm") - { - if (IsSetToDropToSurfaceWithDepth) - _probeController.SetProbePosition( - new Vector4( - transformedApmldv.x, - transformedApmldv.y, - transformedApmldv.z, - brainSurfaceAdjustment - ) - ); - else - _probeController.SetProbePosition(transformedApmldv); - } - else - { - _probeController.SetProbePosition( - new Vector4( - transformedApmldv.x, - transformedApmldv.y, - transformedApmldv.z, - zeroCoordinateAdjustedManipulatorPosition.w - ) - ); - } - - // Log and continue echoing - LogAndContinue(); - return; - - void LogAndContinue() - { - // Don't log if the last position is the same. - var positionDifference = _lastLoggedManipulatorPosition - pos; - if ( - Mathf.Abs(positionDifference.x) > 0.0001 - || Mathf.Abs(positionDifference.y) > 0.0001 - || Mathf.Abs(positionDifference.z) > 0.0001 - || Mathf.Abs(positionDifference.w) > 0.0001 - ) - // Log every 4 hz - if (Time.time - _lastLoggedTime >= 0.25) - { - _lastLoggedTime = Time.time; - var tipPos = _probeController.ProbeTipT.position; - - // ["ephys_link", Real time stamp, Manipulator ID, X, Y, Z, W, Phi, Theta, Spin, TipX, TipY, TipZ] - OutputLog.Log( - new[] - { - "ephys_link", - DateTime.Now.ToString(CultureInfo.InvariantCulture), - ManipulatorID, - pos.x.ToString(CultureInfo.InvariantCulture), - pos.y.ToString(CultureInfo.InvariantCulture), - pos.z.ToString(CultureInfo.InvariantCulture), - pos.w.ToString(CultureInfo.InvariantCulture), - _probeController.Insertion.Yaw.ToString( - CultureInfo.InvariantCulture - ), - _probeController.Insertion.Pitch.ToString( - CultureInfo.InvariantCulture - ), - _probeController.Insertion.Roll.ToString( - CultureInfo.InvariantCulture - ), - tipPos.x.ToString(CultureInfo.InvariantCulture), - tipPos.y.ToString(CultureInfo.InvariantCulture), - tipPos.z.ToString(CultureInfo.InvariantCulture) - } - ); - - // Update last logged position - _lastLoggedManipulatorPosition = pos; - } - - // Continue echoing position - CommunicationManager.Instance.GetPosition(ManipulatorID, EchoPosition); - } - } - - #endregion - } -} diff --git a/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController.meta b/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController.meta new file mode 100644 index 00000000..ecaf62e5 --- /dev/null +++ b/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c2bc1aabdb00c0948831ca62cc76473f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController.cs b/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController.cs new file mode 100644 index 00000000..68590619 --- /dev/null +++ b/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController.cs @@ -0,0 +1,437 @@ +using System; +using System.Globalization; +using System.Linq; +using BrainAtlas; +using BrainAtlas.CoordinateSystems; +using EphysLink; +using Pinpoint.CoordinateSystems; +using UnityEngine; +using UnityEngine.Events; + +namespace Pinpoint.Probes.ManipulatorBehaviorController +{ + public partial class ManipulatorBehaviorController : MonoBehaviour + { + #region Constants + + // Default movement speed: 0.5 mm/s + public const float AUTOMATIC_MOVEMENT_SPEED = 0.5f; + + #endregion + + #region Components + + [SerializeField] + private ProbeManager _probeManager; + + [SerializeField] + private ProbeController _probeController; + + #endregion + + #region Properties + + public string ManipulatorID { get; private set; } + + public int NumAxes { get; set; } + + public Vector3 Dimensions { get; private set; } + + /// + /// Getter and setter or the zero coordinate offset of the manipulator. + /// If passed a NaN value, the previous value is kept. + /// + public Vector4 ReferenceCoordinateOffset + { + get => _referenceCoordinateOffset; + set + { + _referenceCoordinateOffset = new Vector4( + float.IsNaN(value.x) ? _referenceCoordinateOffset.x : value.x, + float.IsNaN(value.y) ? _referenceCoordinateOffset.y : value.y, + float.IsNaN(value.z) ? _referenceCoordinateOffset.z : value.z, + float.IsNaN(value.w) ? _referenceCoordinateOffset.w : value.w + ); + + ZeroCoordinateOffsetChangedEvent.Invoke(_referenceCoordinateOffset); + } + } + + public float BrainSurfaceOffset + { + get => _brainSurfaceOffset; + set + { + _brainSurfaceOffset = value; + BrainSurfaceOffsetChangedEvent.Invoke(_brainSurfaceOffset); + } + } + + public CoordinateSpace CoordinateSpace { get; private set; } + private CoordinateTransform CoordinateTransform { get; set; } + + public bool IsRightHanded + { + get => _isRightHanded; + set + { + _isRightHanded = value; + UpdateSpaceAndTransform(); + } + } + + public readonly ProbeAutomationStateManager ProbeAutomationStateManager = new(); + + // Helper functions to create and destroy a probe + public Action CreatePathfinderProbe { private get; set; } + public Action DestroyThisProbe { private get; set; } + + #region Private internal fields + + private Vector4 _lastLoggedManipulatorPosition = Vector4.zero; + private Vector4 _referenceCoordinateOffset = Vector4.zero; + private float _brainSurfaceOffset; + private bool _isRightHanded; + private float _lastLoggedTime; + private bool _isSetToInsideBrain; + + #endregion + + #endregion + + #region Events + + public UnityEvent ZeroCoordinateOffsetChangedEvent; + public UnityEvent BrainSurfaceOffsetChangedEvent; + public UnityEvent IsSetToDropToSurfaceWithDepthChangedEvent; + + #endregion + + #region Unity + + /// + /// Setup this instance. + /// + private void Awake() + { + // Start off as disabled + enabled = false; + } + + /// + /// Cleanup this instance. + /// + private void OnDisable() + { + ManipulatorID = null; + _referenceCoordinateOffset = Vector4.zero; + _brainSurfaceOffset = 0; + } + + #endregion + + + #region Public Methods + + /// + /// Initialize the manipulator behavior controller with the given manipulator ID and calibration status.
+ /// Starts to echo the manipulator position and locks the manipulator from manual control. + ///
+ /// ID of the manipulator to represent. + /// Whether this manipulator has been calibrated. + public async void Initialize(string manipulatorID, bool calibrated) + { + // Get manipulator information + var manipulatorResponse = await CommunicationManager.Instance.GetManipulators(); + if (CommunicationManager.HasError(manipulatorResponse.Error)) + return; + + // Shortcut exit if we have an invalid manipulator ID + if (!manipulatorResponse.Manipulators.Contains(manipulatorID)) + return; + + // Set manipulator ID, number of axes, and dimensions + ManipulatorID = manipulatorID; + NumAxes = manipulatorResponse.NumAxes; + Dimensions = manipulatorResponse.Dimensions; + + // Update transform and space + UpdateSpaceAndTransform(); + + // Lock the manipulator from manual control + _probeController.SetControllerLock(true); + + // Start echoing the manipulator position. + EchoPosition(); + } + + /// + /// Configure this manipulator's coordinate space and transform based on its handedness, number of axes, and angles. + /// + private void UpdateSpaceAndTransform() + { + CoordinateSpace = new ManipulatorSpace(Dimensions); + CoordinateTransform = NumAxes switch + { + 4 + => IsRightHanded + ? new FourAxisRightHandedManipulatorTransform( + _probeController.Insertion.Yaw + ) + : new FourAxisLeftHandedManipulatorTransform( + _probeController.Insertion.Yaw + ), + 3 + => new ThreeAxisLeftHandedTransform( + _probeController.Insertion.Yaw, + _probeController.Insertion.Pitch + ), + _ => CoordinateTransform + }; + } + + /// + /// Convert insertion AP, ML, DV coordinates to manipulator translation stage position. + /// + /// AP, ML, DV coordinates from an insertion. + /// Computed manipulator translation stage positions to match this coordinate. + public Vector4 ConvertInsertionAPMLDVToManipulatorPosition(Vector3 insertionAPMLDV) + { + // Convert apmldv to world coordinate + var convertToWorld = BrainAtlasManager.ActiveReferenceAtlas.Atlas2World_Vector( + BrainAtlasManager.ActiveAtlasTransform.T2U_Vector(insertionAPMLDV) + ); + + // Convert to Manipulator space + var posInManipulatorSpace = CoordinateSpace.World2Space(convertToWorld); + Vector4 posInManipulatorTransform = CoordinateTransform.U2T(posInManipulatorSpace); + + // Apply brain surface offset + posInManipulatorTransform.w -= float.IsNaN(BrainSurfaceOffset) ? 0 : BrainSurfaceOffset; + + // Apply coordinate offsets and return result + return posInManipulatorTransform + ReferenceCoordinateOffset; + } + + /// + /// Compute if a given AP, ML, DV coordinate is within the manipulator's reach. + /// + /// Coordinate to check. + /// True if the coordinates are within the bounds, false otherwise. + public bool IsAPMLDVWithinManipulatorBounds(Vector3 apmldv) + { + var manipulatorPosition = ConvertInsertionAPMLDVToManipulatorPosition(apmldv); + return !(manipulatorPosition.x < 0) + && !(manipulatorPosition.x > Dimensions.x) + && !(manipulatorPosition.y < 0) + && !(manipulatorPosition.y > Dimensions.y) + && !(manipulatorPosition.z < 0) + && !(manipulatorPosition.z > Dimensions.z); + } + + /// + /// Set manipulator space offset from brain surface as Depth from manipulator or probe coordinates. + /// + public void ComputeBrainSurfaceOffset() + { + if (_probeManager.IsProbeInBrain()) + { + // Just calculate the distance from the probe tip position to the brain surface + BrainSurfaceOffset -= _probeManager.GetSurfaceCoordinateT().depthT; + } + else + { + // We need to calculate the surface coordinate ourselves + var (brainSurfaceCoordinateIdx, _) = _probeManager.CalculateEntryCoordinate(); + + if (float.IsNaN(brainSurfaceCoordinateIdx.x)) + { + Debug.LogError("Could not find brain surface! Canceling set brain offset."); + return; + } + + var brainSurfaceToTransformed = BrainAtlasManager.ActiveAtlasTransform.U2T( + BrainAtlasManager.ActiveReferenceAtlas.World2Atlas( + BrainAtlasManager.ActiveReferenceAtlas.AtlasIdx2World( + brainSurfaceCoordinateIdx + ) + ) + ); + + BrainSurfaceOffset += Vector3.Distance( + brainSurfaceToTransformed, + _probeController.Insertion.APMLDV + ); + } + } + + /// + /// Manual adjustment of brain surface offset. + /// + /// Amount to change the brain surface offset by + public void IncrementBrainSurfaceOffset(float increment) + { + BrainSurfaceOffset += increment; + } + + /// + /// Move manipulator by a given delta in world space + /// + /// Delta (X, Y, Z, D) to move by in world space coordinates + /// True on successful movement, false otherwise. + public async Awaitable MoveByWorldSpaceDelta(Vector4 worldSpaceDelta) + { + // Convert to manipulator axes (world -> space -> transform). + var manipulatorSpaceDelta = CoordinateSpace.World2Space_Vector(worldSpaceDelta); + var manipulatorTransformDelta = CoordinateTransform.U2T(manipulatorSpaceDelta); + var manipulatorSpaceDepth = worldSpaceDelta.w; + + // Get manipulator position. + var positionResponse = await CommunicationManager.Instance.GetPosition(ManipulatorID); + if (CommunicationManager.HasError(positionResponse.Error)) + return false; + + // Apply delta. + var targetPosition = + positionResponse.Position + + new Vector4( + manipulatorTransformDelta.x, + manipulatorTransformDelta.y, + manipulatorTransformDelta.z + ); + + // Move manipulator. + var setPositionResponse = await CommunicationManager.Instance.SetPosition( + new SetPositionRequest(ManipulatorID, targetPosition, AUTOMATIC_MOVEMENT_SPEED) + ); + if (CommunicationManager.HasError(setPositionResponse.Error)) + return false; + + // Process depth movement. + var targetDepth = positionResponse.Position.w + manipulatorSpaceDepth; + + // Move manipulator. + var setDepthResponse = await CommunicationManager.Instance.SetDepth( + new SetDepthRequest(ManipulatorID, targetDepth, AUTOMATIC_MOVEMENT_SPEED) + ); + + return !CommunicationManager.HasError(setDepthResponse.Error); + } + + + #endregion + + #region Private Methods + + /// + /// Echo the manipulator position to the probe controller. + /// + private async void EchoPosition() + { + // Continue echoing position while enabled and there exists a probe controller. + while (enabled && _probeController) + await UpdateProbePositionFromManipulator(); + } + + /// + /// Update the probe's position based on the manipulator's position. + /// + private async Awaitable UpdateProbePositionFromManipulator() + { + // Get manipulator position. + var positionResponse = await CommunicationManager.Instance.GetPosition(ManipulatorID); + + // Shortcut exit if there was an error. + if (CommunicationManager.HasError(positionResponse.Error)) + return; + + // Apply zero coordinate offset. + var zeroCoordinateAdjustedManipulatorPosition = + positionResponse.Position - ReferenceCoordinateOffset; + + // Convert to coordinate space. + var manipulatorSpacePosition = CoordinateTransform.T2U( + zeroCoordinateAdjustedManipulatorPosition + ); + + // Brain surface adjustment. + var brainSurfaceAdjustment = float.IsNaN(BrainSurfaceOffset) ? 0 : BrainSurfaceOffset; + // Apply depth adjustment to manipulator position for non-3 axis manipulators. + if (CoordinateTransform.Prefix != "3lhm") + zeroCoordinateAdjustedManipulatorPosition.w += brainSurfaceAdjustment; + + // Convert to world space. + var zeroCoordinateAdjustedWorldPosition = CoordinateSpace.Space2World( + manipulatorSpacePosition + ); + + // Set probe position (change axes to match probe). + var transformedApmldv = BrainAtlasManager.World2T_Vector( + zeroCoordinateAdjustedWorldPosition + ); + + // Set probe position. + // For 3-axis manipulators, use depth to adjust brain offset if applying offset on depth. + if (CoordinateTransform.Prefix == "3lhm") + _probeController.SetProbePosition( + new Vector4( + transformedApmldv.x, + transformedApmldv.y, + transformedApmldv.z, + brainSurfaceAdjustment + ) + ); + else + _probeController.SetProbePosition( + new Vector4( + transformedApmldv.x, + transformedApmldv.y, + transformedApmldv.z, + zeroCoordinateAdjustedManipulatorPosition.w + ) + ); + + // Don't log if the last position is the same. + var positionDifference = _lastLoggedManipulatorPosition - positionResponse.Position; + if ( + !(Mathf.Abs(positionDifference.x) > 0.0001) + && !(Mathf.Abs(positionDifference.y) > 0.0001) + && !(Mathf.Abs(positionDifference.z) > 0.0001) + && !(Mathf.Abs(positionDifference.w) > 0.0001) + ) + return; + + // Log every 4 hz + if (!(Time.time - _lastLoggedTime >= 0.25)) + return; + + _lastLoggedTime = Time.time; + var tipPos = _probeController.ProbeTipT.position; + + // ["ephys_link", Real time stamp, Manipulator ID, X, Y, Z, W, Phi, Theta, Spin, TipX, TipY, TipZ] + OutputLog.Log( + new[] + { + "ephys_link", + DateTime.Now.ToString(CultureInfo.InvariantCulture), + ManipulatorID, + positionResponse.Position.x.ToString(CultureInfo.InvariantCulture), + positionResponse.Position.y.ToString(CultureInfo.InvariantCulture), + positionResponse.Position.z.ToString(CultureInfo.InvariantCulture), + positionResponse.Position.w.ToString(CultureInfo.InvariantCulture), + _probeController.Insertion.Yaw.ToString(CultureInfo.InvariantCulture), + _probeController.Insertion.Pitch.ToString(CultureInfo.InvariantCulture), + _probeController.Insertion.Roll.ToString(CultureInfo.InvariantCulture), + tipPos.x.ToString(CultureInfo.InvariantCulture), + tipPos.y.ToString(CultureInfo.InvariantCulture), + tipPos.z.ToString(CultureInfo.InvariantCulture) + } + ); + + // Update last logged position + _lastLoggedManipulatorPosition = positionResponse.Position; + } + + #endregion + } +} diff --git a/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController.cs.meta b/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController.cs.meta similarity index 100% rename from Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController.cs.meta rename to Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController.cs.meta diff --git a/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_Automation_DuraCalibration.cs b/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_Automation_DuraCalibration.cs new file mode 100644 index 00000000..e59d481d --- /dev/null +++ b/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_Automation_DuraCalibration.cs @@ -0,0 +1,99 @@ +using System; +using System.Globalization; +using EphysLink; +using UnityEngine; + +namespace Pinpoint.Probes.ManipulatorBehaviorController +{ + /// + /// Manage the Dura calibration of the manipulator. + /// + public partial class ManipulatorBehaviorController + { + #region Properties + + /// + /// Record of the manipulator's depth at the Dura. + /// + private float _duraDepth; + + /// + /// AP, ML, DV coordinate of the Dura. + /// + private Vector3 _duraCoordinate; + + /// + /// Skip passing through the exit margin. + /// + private bool _skipExitMargin; + + #endregion + + /// + /// Reset the dura offset of the probe and enable the next step + /// + /// True if the dura offset was reset successfully, false otherwise. + public async Awaitable ResetDuraOffset() + { + // Get the current manipulator depth. + var positionResponse = await CommunicationManager.Instance.GetPosition(ManipulatorID); + if (CommunicationManager.HasError(positionResponse.Error)) + return false; + + // Save the Dura's position. + _duraDepth = positionResponse.Position.w; + + // Check if there is enough room for exit margin. + var continueWithDuraResetCompletionSource = new AwaitableCompletionSource(); + + // Alert user if there is not enough space for exit margin. + if (_duraDepth < 1.5f * DURA_MARGIN_DISTANCE) + { + QuestionDialogue.Instance.NewQuestion( + "The depth axis is too retracted and does not leave enough space for a safe exit. Are you sure you want to continue (safety measures will be skipped)?" + ); + QuestionDialogue.Instance.YesCallback = () => + { + continueWithDuraResetCompletionSource.SetResult(true); + + // Mark that they are ok with skipping the exit margin. + _skipExitMargin = true; + }; + QuestionDialogue.Instance.NoCallback = () => + continueWithDuraResetCompletionSource.SetResult(false); + } + else + { + continueWithDuraResetCompletionSource.SetResult(true); + } + + // Shortcut exit if user does not want to continue. + if (!await continueWithDuraResetCompletionSource.Awaitable) + return false; + + // Reset dura offset. + ComputeBrainSurfaceOffset(); + + // Force update probe position. + await UpdateProbePositionFromManipulator(); + + // Save the probe's coordinates at the Dura. + _duraCoordinate = _probeController.Insertion.APMLDV; + + // Log the event. + OutputLog.Log( + new[] + { + "Automation", + DateTime.Now.ToString(CultureInfo.InvariantCulture), + "ResetDuraOffset", + ManipulatorID, + BrainSurfaceOffset.ToString(CultureInfo.InvariantCulture) + } + ); + + // Return success. + return true; + } + } +} diff --git a/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_Automation_DuraCalibration.cs.meta b/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_Automation_DuraCalibration.cs.meta new file mode 100644 index 00000000..9368860b --- /dev/null +++ b/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_Automation_DuraCalibration.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 0609c7d3d307feb4cb539412cc7669ec diff --git a/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_Automation_Insertion.cs b/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_Automation_Insertion.cs new file mode 100644 index 00000000..09c896a8 --- /dev/null +++ b/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_Automation_Insertion.cs @@ -0,0 +1,492 @@ +using System; +using System.Globalization; +using BrainAtlas; +using EphysLink; +using UnityEngine; + +namespace Pinpoint.Probes.ManipulatorBehaviorController +{ + public partial class ManipulatorBehaviorController + { + #region Constants + + #region Relative distances + + /// + /// Extra safety margin for the Dura to outside to ensure probe is fully retracted (mm). + /// + private const float DURA_MARGIN_DISTANCE = 0.2f; + + /// + /// Distance from target to start slowing down probe (mm). + /// + private const float NEAR_TARGET_DISTANCE = 1f; + + #endregion + + #region Speed multipliers + + /// + /// Slowdown factor for the probe when it is near the target. + /// + private const float NEAR_TARGET_SPEED_MULTIPLIER = 2f / 3f; + + /// + /// Extra speed multiplier for the probe when it is exiting. + /// + private const int EXIT_DRIVE_SPEED_MULTIPLIER = 6; + + #endregion + + #endregion + + #region Properties + + /// + /// Is the probe driving in the insertion cycle? + /// + /// Used to identify which buttons should be made available. + public bool IsMoving { get; private set; } + + private float _actualExitMarginToDuraDistance => _duraDepth - _entryCoordinateDepth; + + #endregion + + #region Drive Functions + + /// + /// Start or resume inserting the probe to the target insertion. + /// + /// Probe manager for the target insertion. + /// Base driving speed in mm/s. + /// Distance to drive past target in mm. + /// Probe is not in a drivable state. + /// Unhandled probe drive state. + public async void Drive( + ProbeManager targetInsertionProbeManager, + float baseSpeed, + float drivePastDistance + ) + { + while ( + ProbeAutomationStateManager.ProbeAutomationState != ProbeAutomationState.AtTarget + ) + { + // Throw exception if state is not valid. + if (!ProbeAutomationStateManager.IsInsertable()) + throw new InvalidOperationException( + "Cannot drive to target insertion if the probe is not in a drivable state." + ); + + // Get target depth. + var targetDepth = GetTargetDepth(targetInsertionProbeManager); + + // Set state to driving state (if needed). + ProbeAutomationStateManager.SetToInsertionDrivingState(); + + // Log set to driving state. + LogDriveToTargetInsertion(targetDepth, baseSpeed, drivePastDistance); + + // Set probe to be moving. + IsMoving = true; + + // Handle driving state. + switch (ProbeAutomationStateManager.ProbeAutomationState) + { + case ProbeAutomationState.DrivingToNearTarget: + // Drive to near target if not already there. + if ( + GetCurrentDistanceToTarget(targetInsertionProbeManager) + > NEAR_TARGET_DISTANCE + ) + { + var driveToNearTargetResponse = + await CommunicationManager.Instance.SetDepth( + new SetDepthRequest( + ManipulatorID, + targetDepth - NEAR_TARGET_DISTANCE, + baseSpeed + ) + ); + + // Shortcut exit if there was an error. + if (CommunicationManager.HasError(driveToNearTargetResponse.Error)) + return; + } + + break; + case ProbeAutomationState.DrivingToPastTarget: + // Drive to past target. + var driveToPastTargetResponse = + await CommunicationManager.Instance.SetDepth( + new SetDepthRequest( + ManipulatorID, + targetDepth + drivePastDistance, + baseSpeed * NEAR_TARGET_SPEED_MULTIPLIER + ) + ); + + // Shortcut exit if there was an error. + if (CommunicationManager.HasError(driveToPastTargetResponse.Error)) + return; + break; + case ProbeAutomationState.ReturningToTarget: + // Drive up to target. + var returnToTargetResponse = await CommunicationManager.Instance.SetDepth( + new SetDepthRequest( + ManipulatorID, + targetDepth, + baseSpeed * NEAR_TARGET_SPEED_MULTIPLIER + ) + ); + + // Shortcut exit if there was an error. + if (CommunicationManager.HasError(returnToTargetResponse.Error)) + return; + break; + case ProbeAutomationState.IsUncalibrated: + case ProbeAutomationState.IsCalibrated: + case ProbeAutomationState.DrivingToTargetEntryCoordinate: + case ProbeAutomationState.AtEntryCoordinate: + case ProbeAutomationState.AtDuraInsert: + case ProbeAutomationState.AtNearTargetInsert: + case ProbeAutomationState.AtPastTarget: + case ProbeAutomationState.AtTarget: + case ProbeAutomationState.ExitingToDura: + case ProbeAutomationState.AtDuraExit: + case ProbeAutomationState.ExitingToMargin: + case ProbeAutomationState.AtExitMargin: + case ProbeAutomationState.ExitingToTargetEntryCoordinate: + throw new InvalidOperationException( + $"Not a valid driving state: {ProbeAutomationStateManager.ProbeAutomationState}" + ); + default: + throw new ArgumentOutOfRangeException( + $"Unhandled probe drive state: {ProbeAutomationStateManager.ProbeAutomationState}" + ); + } + + // Increment cycle state. + ProbeAutomationStateManager.IncrementInsertionCycleState(); + + // Log the event. + LogDriveToTargetInsertion(targetDepth, baseSpeed, drivePastDistance); + } + + // Set probe to be done moving. + IsMoving = false; + } + + /// + /// Stop the probe's insertion. + /// + public async void StopInsertion() + { + var stopResponse = await CommunicationManager.Instance.Stop(ManipulatorID); + + // Log and exit if there was an error. + if (!string.IsNullOrEmpty(stopResponse)) + { + Debug.LogError(stopResponse); + return; + } + + // Set probe to be not moving. + IsMoving = false; + + // Log stop event. + OutputLog.Log( + new[] + { + "Automation", + DateTime.Now.ToString(CultureInfo.InvariantCulture), + "Drive", + ManipulatorID, + "Stop" + } + ); + } + + /// + /// Start or resume exiting the probe to the target insertion. + /// + /// Probe manager for the target insertion. + /// Base driving speed in mm/s. + /// Probe is not in an exitable state. + /// Unhandled probe exit state. + /// True when exited out to entry coordinate, false otherwise. + public async Awaitable Exit(ProbeManager targetInsertionProbeManager, float baseSpeed) + { + while ( + ProbeAutomationStateManager.ProbeAutomationState + != ProbeAutomationState.AtEntryCoordinate + ) + { + // Throw exception if state is not valid. + if (!ProbeAutomationStateManager.IsExitable()) + throw new InvalidOperationException( + "Cannot exit to target insertion if the probe is not in a state that can exit." + ); + + // Get target depth. + var targetDepth = GetTargetDepth(targetInsertionProbeManager); + + // Set state to exiting state (if needed). + ProbeAutomationStateManager.SetToExitingDrivingState(); + + // Log set to exiting state. + LogDriveToTargetInsertion(targetDepth, baseSpeed); + + // Set probe to be moving. + IsMoving = true; + + // Handle exiting state. + switch (ProbeAutomationStateManager.ProbeAutomationState) + { + case ProbeAutomationState.ExitingToDura: + // Exit back up to the Dura. + var exitToDuraResponse = await CommunicationManager.Instance.SetDepth( + new SetDepthRequest( + ManipulatorID, + _duraDepth, + baseSpeed * EXIT_DRIVE_SPEED_MULTIPLIER + ) + ); + + // Shortcut exit if there was an error. + if (CommunicationManager.HasError(exitToDuraResponse.Error)) + return false; + break; + case ProbeAutomationState.ExitingToMargin: + // Remove brain surface offset. + BrainSurfaceOffset = 0; + + // Shortcut skip if user wanted to skip exit margin. + if (_skipExitMargin) + break; + + // Exit to the safe margin above the Dura. + var exitToMarginResponse = await CommunicationManager.Instance.SetDepth( + new SetDepthRequest( + ManipulatorID, + _duraDepth - DURA_MARGIN_DISTANCE, + baseSpeed * EXIT_DRIVE_SPEED_MULTIPLIER + ) + ); + + // Shortcut exit if there was an error. + if (CommunicationManager.HasError(exitToMarginResponse.Error)) + return false; + break; + case ProbeAutomationState.ExitingToTargetEntryCoordinate: + // Drive to the target entry coordinate (same place before calibrating to the Dura). + var exitToTargetEntryCoordinateResponse = + await CommunicationManager.Instance.SetPosition( + new SetPositionRequest( + ManipulatorID, + ConvertInsertionAPMLDVToManipulatorPosition( + _trajectoryCoordinates.third + ), + AUTOMATIC_MOVEMENT_SPEED + ) + ); + + // Shortcut exit if there was an error. + if ( + CommunicationManager.HasError(exitToTargetEntryCoordinateResponse.Error) + ) + return false; + + break; + case ProbeAutomationState.IsUncalibrated: + case ProbeAutomationState.IsCalibrated: + case ProbeAutomationState.DrivingToTargetEntryCoordinate: + case ProbeAutomationState.AtEntryCoordinate: + case ProbeAutomationState.AtDuraInsert: + case ProbeAutomationState.DrivingToNearTarget: + case ProbeAutomationState.AtNearTargetInsert: + case ProbeAutomationState.DrivingToPastTarget: + case ProbeAutomationState.AtPastTarget: + case ProbeAutomationState.ReturningToTarget: + case ProbeAutomationState.AtTarget: + case ProbeAutomationState.AtDuraExit: + case ProbeAutomationState.AtExitMargin: + throw new InvalidOperationException( + $"Not a valid exit state: {ProbeAutomationStateManager.ProbeAutomationState}" + ); + default: + throw new ArgumentOutOfRangeException( + $"Unhandled probe exit state: {ProbeAutomationStateManager.ProbeAutomationState}" + ); + } + + // Increment cycle state. + ProbeAutomationStateManager.IncrementInsertionCycleState(); + + // Log the event. + LogDriveToTargetInsertion(targetDepth, baseSpeed); + } + + // Set probe to be done moving. + IsMoving = false; + + // Indicate that the exit has completed. + return true; + } + + #endregion + + #region Helper Functions + + /// + /// Log a drive event. + /// + /// Target depth of drive. + /// Base speed of drive. + /// Distance (mm) driven past the target. Only supplied in insertion drives. + private void LogDriveToTargetInsertion( + float targetDepth, + float baseSpeed, + float drivePastDistance = 0 + ) + { + OutputLog.Log( + new[] + { + "Automation", + DateTime.Now.ToString(CultureInfo.InvariantCulture), + "DriveToTargetInsertion", + ManipulatorID, + ProbeAutomationStateManager.ProbeAutomationState.ToString(), + targetDepth.ToString(CultureInfo.InvariantCulture), + baseSpeed.ToString(CultureInfo.InvariantCulture), + drivePastDistance.ToString(CultureInfo.InvariantCulture) + } + ); + } + + /// + /// Compute the target coordinate adjusted for the probe's actual position. + /// + /// + /// APMLDV coordinates of where the probe should actually go. + private Vector3 GetOffsetAdjustedTargetCoordinate(ProbeManager targetInsertionProbeManager) + { + // Extract target insertion. + var targetInsertion = targetInsertionProbeManager.ProbeController.Insertion; + + var targetWorldT = targetInsertion.PositionWorldT(); + var relativePositionWorldT = _probeController.Insertion.PositionWorldT() - targetWorldT; + var probeTipTForward = _probeController.ProbeTipT.forward; + var offsetAdjustedRelativeTargetPositionWorldT = Vector3.ProjectOnPlane( + relativePositionWorldT, + probeTipTForward + ); + var offsetAdjustedTargetCoordinateWorldT = + targetWorldT + offsetAdjustedRelativeTargetPositionWorldT; + + // Converting worldT to AtlasT (to capture new reference coordinate offset when there is scaling) + // then switch axes to get APMLDV. + var offsetAdjustedTargetCoordinateAtlasT = + BrainAtlasManager.ActiveReferenceAtlas.World2Atlas( + offsetAdjustedTargetCoordinateWorldT + ); + var offsetAdjustedTargetCoordinateT = BrainAtlasManager.ActiveAtlasTransform.U2T_Vector( + offsetAdjustedTargetCoordinateAtlasT + ); + + return offsetAdjustedTargetCoordinateT; + } + + /// + /// Compute the absolute distance from the target insertion to the Dura. + /// + /// Target to computer distance to. + /// Distance in mm to the target from the Dura. + private float GetTargetDistanceToDura(ProbeManager targetInsertionProbeManager) + { + return Vector3.Distance( + GetOffsetAdjustedTargetCoordinate(targetInsertionProbeManager), + _duraCoordinate + ); + } + + /// + /// Compute the current distance to the target insertion. + /// + /// + /// Distance in mm to the target from the probe. NaN on error. + private float GetCurrentDistanceToTarget(ProbeManager targetInsertionProbeManager) + { + return Vector3.Distance( + _probeController.Insertion.APMLDV, + GetOffsetAdjustedTargetCoordinate(targetInsertionProbeManager) + ); + } + + /// + /// Compute the target depth for the probe to drive to. + /// + /// Target to drive (insert) to. + /// The depth the manipulator needs to drive to reach the target insertion. + private float GetTargetDepth(ProbeManager targetInsertionProbeManager) + { + return _duraDepth + GetTargetDistanceToDura(targetInsertionProbeManager); + } + + /// + /// Compute the ETA for a probe to reach a target insertion (or exit). + /// + /// Target to calculate ETA to. + /// Base driving speed in mm/s. + /// Distance to drive past target in mm. + /// MM:SS format ETA for reaching a target or exiting, based on the probe's state. + public string GetETA( + ProbeManager targetInsertionProbeManager, + float baseSpeed, + float drivePastDistance + ) + { + // Get current distance to target. + var distanceToTarget = GetCurrentDistanceToTarget(targetInsertionProbeManager); + + // Compute ETA. + var secondsToDestination = ProbeAutomationStateManager.ProbeAutomationState switch + { + ProbeAutomationState.DrivingToNearTarget + => Mathf.Max(0, distanceToTarget - NEAR_TARGET_DISTANCE) / baseSpeed // To near target. + + (NEAR_TARGET_DISTANCE + 2 * drivePastDistance) + / (baseSpeed * NEAR_TARGET_SPEED_MULTIPLIER), // To past target and back to target. + ProbeAutomationState.DrivingToPastTarget + => (distanceToTarget + 2 * drivePastDistance) + / (baseSpeed * NEAR_TARGET_SPEED_MULTIPLIER), // To past target and back to target. + ProbeAutomationState.ReturningToTarget + => distanceToTarget / (baseSpeed * NEAR_TARGET_SPEED_MULTIPLIER), // Back to target. + ProbeAutomationState.ExitingToDura + => (GetTargetDistanceToDura(targetInsertionProbeManager) - distanceToTarget) + / (baseSpeed * EXIT_DRIVE_SPEED_MULTIPLIER) // To Dura. + + DURA_MARGIN_DISTANCE / (baseSpeed * EXIT_DRIVE_SPEED_MULTIPLIER) // To exit margin. + + _actualExitMarginToDuraDistance / AUTOMATIC_MOVEMENT_SPEED, // To entry coordinate. + ProbeAutomationState.ExitingToMargin + => ( + DURA_MARGIN_DISTANCE + - (distanceToTarget - GetTargetDistanceToDura(targetInsertionProbeManager)) + ) / (baseSpeed * EXIT_DRIVE_SPEED_MULTIPLIER) // To exit margin. + + _actualExitMarginToDuraDistance / AUTOMATIC_MOVEMENT_SPEED, // To entry coordinate. + ProbeAutomationState.ExitingToTargetEntryCoordinate + => ( + IDEAL_ENTRY_COORDINATE_TO_DURA_DISTANCE + - (distanceToTarget - GetTargetDistanceToDura(targetInsertionProbeManager)) + ) / AUTOMATIC_MOVEMENT_SPEED, + _ => 0 + }; + + // Return formatted time if above 1 minute. + return secondsToDestination < 60 + ? secondsToDestination.ToString("F1") + : TimeSpan.FromSeconds(secondsToDestination).ToString(@"mm\:ss"); + } + + #endregion + } +} diff --git a/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_Automation_Insertion.cs.meta b/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_Automation_Insertion.cs.meta new file mode 100644 index 00000000..3bf4072a --- /dev/null +++ b/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_Automation_Insertion.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: bbc85cfb8bef2b54a8d4643231d64cf7 diff --git a/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_Automation_ReferenceCoordinate.cs b/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_Automation_ReferenceCoordinate.cs new file mode 100644 index 00000000..dd41123d --- /dev/null +++ b/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_Automation_ReferenceCoordinate.cs @@ -0,0 +1,90 @@ +using System; +using System.Globalization; +using EphysLink; +using UnityEngine; + +namespace Pinpoint.Probes.ManipulatorBehaviorController +{ + public partial class ManipulatorBehaviorController + { + #region Constants + + /// + /// How far the depth axis can be off center of its range before the user is warned. + /// + /// Applies to 3-axis manipulators when calibrating. + private const float CENTER_DEVIATION_FACTOR = 0.125f; + + #endregion + + /// + /// Reset reference coordinate of the manipulator + /// + /// + /// Alerts user of 4-axis manipulators if depth axis is not at 0 and 3-axis manipulators if depth is too far from + /// center. + /// + public async Awaitable ResetReferenceCoordinate() + { + // Query current position. + var positionalResponse = await CommunicationManager.Instance.GetPosition(ManipulatorID); + + // Shortcut exit if error. + if (CommunicationManager.HasError(positionalResponse.Error)) + return false; + + // Setup callback completion source. + var canDoResetCompletionSource = new AwaitableCompletionSource(); + + // Setup alert callbacks (continue with reset). + QuestionDialogue.Instance.YesCallback = () => + canDoResetCompletionSource.SetResult(true); + QuestionDialogue.Instance.NoCallback = () => + canDoResetCompletionSource.SetResult(false); + + // Check depth position and alert. + switch (NumAxes) + { + case 3 + when Mathf.Abs(Dimensions.z / 2f - positionalResponse.Position.w) + > CENTER_DEVIATION_FACTOR * Dimensions.z: + QuestionDialogue.Instance.NewQuestion( + "The depth axis is too far from the center of its range and may not have enough space to reach the target. Are you sure you want to continue?" + ); + break; + case 4 when positionalResponse.Position.w > Dimensions.z * 0.05f: + QuestionDialogue.Instance.NewQuestion( + "The depth axis is not retracted and may not have enough space to reach the target. Are you sure you want to continue?" + ); + break; + default: + canDoResetCompletionSource.SetResult(true); + break; + } + + // Wait for verification to continue. + var canDoReset = await canDoResetCompletionSource.Awaitable; + + // Shortcut exit if reset is canceled. + if (!canDoReset) + return false; + + // Complete reset. + ReferenceCoordinateOffset = positionalResponse.Position; + BrainSurfaceOffset = 0; + + // Log event. + OutputLog.Log( + new[] + { + "Automation", + DateTime.Now.ToString(CultureInfo.InvariantCulture), + "ResetReferenceCoordinate", + ManipulatorID, + ReferenceCoordinateOffset.ToString() + } + ); + return true; + } + } +} diff --git a/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_Automation_ReferenceCoordinate.cs.meta b/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_Automation_ReferenceCoordinate.cs.meta new file mode 100644 index 00000000..a0c24d89 --- /dev/null +++ b/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_Automation_ReferenceCoordinate.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 2f99a30517f49f04fa41d8524a7c4357 \ No newline at end of file diff --git a/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_Automation_TargetInsertion.cs b/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_Automation_TargetInsertion.cs new file mode 100644 index 00000000..0279209d --- /dev/null +++ b/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_Automation_TargetInsertion.cs @@ -0,0 +1,386 @@ +using System; +using System.Globalization; +using BrainAtlas; +using EphysLink; +using UnityEngine; + +namespace Pinpoint.Probes.ManipulatorBehaviorController +{ + public partial class ManipulatorBehaviorController + { + #region Constants + + // Axes colors. + private static readonly Color AP_COLOR = new(1, 0.3215686f, 0.3215686f); + private static readonly Color ML_COLOR = new(0.2039216f, 0.6745098f, 0.8784314f); + private static readonly Color DV_COLOR = new(1, 0.854902f, 0.4745098f); + + // Trajectory line properties. + private const float LINE_WIDTH = 0.1f; + private const int NUM_SEGMENTS = 2; + + // Trajectory values. + public static readonly Vector3 PRE_DEPTH_DRIVE_DV_OFFSET = new(0, 3.5f, 0); + + /// + /// Distance from the entry coordinate to the Dura. This is considered a safe distance to put the probe. + /// + private const float IDEAL_ENTRY_COORDINATE_TO_DURA_DISTANCE = 3.5f; + + #endregion + + #region Components + + private (GameObject ap, GameObject ml, GameObject dv) _trajectoryLineGameObjects; + private (LineRenderer ap, LineRenderer ml, LineRenderer dv) _trajectoryLineLineRenderers; + + #endregion + + #region Properties + + /// + /// Trajectory broken into 3 stages (for 3 axes of movement). + /// + /// Execution order: DV, AP, ML. Defaults to negative infinity when there is no trajectory. + private (Vector3 first, Vector3 second, Vector3 third) _trajectoryCoordinates = ( + Vector3.negativeInfinity, + Vector3.negativeInfinity, + Vector3.negativeInfinity + ); + + /// + /// Record the depth at the entry coordinate. + /// + /// Used during insertion to calculate the actual distance needed to retract back to the entry coordinate. + private float _entryCoordinateDepth; + + #endregion + + #region Public Functions + + /// + /// Compute the entry coordinate and trajectory for the target insertion. Also, draw the trajectory lines. + /// + /// Probe manager of the target insertion + /// + /// The computed entry coordinate in AP, ML, DV coordinates. Negative infinity if target is unset or already + /// there. + /// + public Vector3 ComputeEntryCoordinateTrajectory(ProbeManager targetInsertionProbeManager) + { + // If set to null or already past the entry coordinate, cleanup and remove insertion trajectory. + if ( + targetInsertionProbeManager == null + || ProbeAutomationStateManager.HasReachedTargetEntryCoordinate() + ) + { + RemoveTrajectoryLines(); + return Vector3.negativeInfinity; + } + + // Compute the trajectory. + ComputeTargetEntryCoordinateTrajectory(targetInsertionProbeManager); + + // Create trajectory lines. + CreateTrajectoryLines(); + + // Set trajectory lines. + UpdateTrajectoryLines(); + + // Return final entry coordinate (coordinate of the ML movement, the last in the trajectory). + return _trajectoryCoordinates.third; + } + + /// + /// Move the probe along the planned trajectory to the target entry coordinate.
+ ///
+ /// No trajectory planned for probe + /// Will log that movement has started and completed. + /// True if movement was successful, false otherwise. + public async Awaitable DriveToTargetEntryCoordinate() + { + // Throw exception if invariant is violated. + if (float.IsNegativeInfinity(_trajectoryCoordinates.first.x)) + throw new InvalidOperationException( + "No trajectory planned for probe " + _probeManager.name + ); + + // Convert insertions to manipulator positions. + var dvPosition = ConvertInsertionAPMLDVToManipulatorPosition( + _trajectoryCoordinates.first + ); + var apPosition = ConvertInsertionAPMLDVToManipulatorPosition( + _trajectoryCoordinates.second + ); + var mlPosition = ConvertInsertionAPMLDVToManipulatorPosition( + _trajectoryCoordinates.third + ); + + // Log that movement is starting. + OutputLog.Log( + new[] + { + "Automation", + DateTime.Now.ToString(CultureInfo.InvariantCulture), + "DriveToTargetEntryCoordinate", + ManipulatorID, + "Start" + } + ); + + // First move. + var firstMoveResponse = await CommunicationManager.Instance.SetPosition( + new SetPositionRequest(ManipulatorID, dvPosition, AUTOMATIC_MOVEMENT_SPEED) + ); + + // Shortcut exit if error. + if (CommunicationManager.HasError(firstMoveResponse.Error)) + { + LogDriveToTargetEntryCoordinateProgress("Failed to move to DV position."); + return false; + } + + // Second move. + var secondMoveResponse = await CommunicationManager.Instance.SetPosition( + new SetPositionRequest(ManipulatorID, apPosition, AUTOMATIC_MOVEMENT_SPEED) + ); + + // Shortcut exit if error. + if (CommunicationManager.HasError(secondMoveResponse.Error)) + { + LogDriveToTargetEntryCoordinateProgress("Failed to move to AP position."); + return false; + } + + // Third move. + var thirdMoveResponse = await CommunicationManager.Instance.SetPosition( + new SetPositionRequest(ManipulatorID, mlPosition, AUTOMATIC_MOVEMENT_SPEED) + ); + + // Shortcut exit if error. + if (CommunicationManager.HasError(thirdMoveResponse.Error)) + { + LogDriveToTargetEntryCoordinateProgress("Failed to move to ML position."); + return false; + } + + // Complete drive. + + // Record depth at entry coordinate. + var entryCoordinatePositionResponse = await CommunicationManager.Instance.GetPosition( + ManipulatorID + ); + if (CommunicationManager.HasError(entryCoordinatePositionResponse.Error)) + { + LogDriveToTargetEntryCoordinateProgress( + "Failed to get final position at entry coordinate." + ); + return false; + } + + _entryCoordinateDepth = entryCoordinatePositionResponse.Position.w; + + // Remove trajectory lines. + RemoveTrajectoryLines(); + + // Log drive finished. + LogDriveToTargetEntryCoordinateProgress("Finish"); + + // Return success. + return true; + } + + /// + /// Stop the probe from moving to the target entry coordinate. + /// + /// Will log that movement has stopped. + /// True if movement was stopped successfully, false otherwise. + public async Awaitable StopDriveToTargetEntryCoordinate() + { + // Log that movement is stopping. + LogDriveToTargetEntryCoordinateProgress("Stopped"); + + // Stop movement. + var stopResponse = await CommunicationManager.Instance.Stop(ManipulatorID); + + // Shortcut exit if no errors. + if (string.IsNullOrEmpty(stopResponse)) + return true; + + // Log errors. + Debug.LogError(stopResponse); + return false; + } + + #endregion + + #region Internal Functions + + /// + /// Compute the trajectory to the target insertion entry coordinate. + /// + /// Probe manager of the target insertion to compute the entry coordinate for. + private void ComputeTargetEntryCoordinateTrajectory( + ProbeManager targetInsertionProbeManager + ) + { + // Compute entry coordinate in world space. + var entryCoordinateWorld = + targetInsertionProbeManager.GetSurfaceCoordinateWorldT() + - targetInsertionProbeManager.ProbeController.GetTipWorldU().tipForwardWorldU + * IDEAL_ENTRY_COORDINATE_TO_DURA_DISTANCE; + + // Convert world space to transformed space. + var entryCoordinateAPMLDV = BrainAtlasManager.ActiveAtlasTransform.U2T( + BrainAtlasManager.ActiveReferenceAtlas.World2Atlas(entryCoordinateWorld) + ); + + // Get current probe coordinate. + var currentCoordinate = _probeManager.ProbeController.Insertion.APMLDV; + + // Set first movement (DV). + _trajectoryCoordinates.first = new Vector3( + currentCoordinate.x, + currentCoordinate.y, + entryCoordinateAPMLDV.z + ); + + // Set second movement (AP). + _trajectoryCoordinates.second = new Vector3( + entryCoordinateAPMLDV.x, + currentCoordinate.y, + entryCoordinateAPMLDV.z + ); + + // Set third movement (ML). + _trajectoryCoordinates.third = entryCoordinateAPMLDV; + } + + /// + /// Create the trajectory line game objects and line renderers (if needed). + /// + private void CreateTrajectoryLines() + { + // Shortcut exit if they already exist. + if (_trajectoryLineGameObjects.ap != null) + return; + + // Create the trajectory line game objects. + _trajectoryLineGameObjects = ( + new GameObject("APTrajectoryLine") { layer = 5 }, + new GameObject("MLTrajectoryLine") { layer = 5 }, + new GameObject("DVTrajectoryLine") { layer = 5 } + ); + + // Create the line renderers. + _trajectoryLineLineRenderers = ( + _trajectoryLineGameObjects.ap.AddComponent(), + _trajectoryLineGameObjects.ml.AddComponent(), + _trajectoryLineGameObjects.dv.AddComponent() + ); + + // Apply materials. + var defaultSpriteShader = Shader.Find("Sprites/Default"); + _trajectoryLineLineRenderers.ap.material = new Material(defaultSpriteShader) + { + color = AP_COLOR + }; + _trajectoryLineLineRenderers.ml.material = new Material(defaultSpriteShader) + { + color = ML_COLOR + }; + _trajectoryLineLineRenderers.dv.material = new Material(defaultSpriteShader) + { + color = DV_COLOR + }; + + // Set line widths. + _trajectoryLineLineRenderers.ap.startWidth = _trajectoryLineLineRenderers.ap.endWidth = + LINE_WIDTH; + _trajectoryLineLineRenderers.ml.startWidth = _trajectoryLineLineRenderers.ml.endWidth = + LINE_WIDTH; + _trajectoryLineLineRenderers.dv.startWidth = _trajectoryLineLineRenderers.dv.endWidth = + LINE_WIDTH; + + // Set segment counts. + _trajectoryLineLineRenderers.ap.positionCount = NUM_SEGMENTS; + _trajectoryLineLineRenderers.ml.positionCount = NUM_SEGMENTS; + _trajectoryLineLineRenderers.dv.positionCount = NUM_SEGMENTS; + } + + /// + /// Update the trajectory line positions. + /// + private void UpdateTrajectoryLines() + { + _trajectoryLineLineRenderers.dv.SetPosition(0, _probeController.ProbeTipT.position); + _trajectoryLineLineRenderers.dv.SetPosition( + 1, + BrainAtlasManager.ActiveReferenceAtlas.Atlas2World( + BrainAtlasManager.ActiveAtlasTransform.T2U_Vector(_trajectoryCoordinates.first) + ) + ); + + _trajectoryLineLineRenderers.ap.SetPosition( + 0, + BrainAtlasManager.ActiveReferenceAtlas.Atlas2World( + BrainAtlasManager.ActiveAtlasTransform.T2U_Vector(_trajectoryCoordinates.first) + ) + ); + _trajectoryLineLineRenderers.ap.SetPosition( + 1, + BrainAtlasManager.ActiveReferenceAtlas.Atlas2World( + BrainAtlasManager.ActiveAtlasTransform.T2U_Vector(_trajectoryCoordinates.second) + ) + ); + + _trajectoryLineLineRenderers.ml.SetPosition( + 0, + BrainAtlasManager.ActiveReferenceAtlas.Atlas2World( + BrainAtlasManager.ActiveAtlasTransform.T2U_Vector(_trajectoryCoordinates.second) + ) + ); + _trajectoryLineLineRenderers.ml.SetPosition( + 1, + BrainAtlasManager.ActiveReferenceAtlas.Atlas2World( + BrainAtlasManager.ActiveAtlasTransform.T2U_Vector(_trajectoryCoordinates.third) + ) + ); + } + + /// + /// Destroy the trajectory line game objects and line renderers. Also reset the references. + /// + private void RemoveTrajectoryLines() + { + // Destroy the objects. + Destroy(_trajectoryLineGameObjects.ap); + Destroy(_trajectoryLineGameObjects.ml); + Destroy(_trajectoryLineGameObjects.dv); + + // Reset the references. + _trajectoryLineGameObjects = (null, null, null); + _trajectoryLineLineRenderers = (null, null, null); + } + + /// + /// Log the progress of the drive to the target entry coordinate. + /// + /// Message to log + private void LogDriveToTargetEntryCoordinateProgress(string progressMessage) + { + OutputLog.Log( + new[] + { + "Automation", + DateTime.Now.ToString(CultureInfo.InvariantCulture), + "DriveToTargetEntryCoordinate", + ManipulatorID, + progressMessage + } + ); + } + + #endregion + } +} diff --git a/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_Automation_TargetInsertion.cs.meta b/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_Automation_TargetInsertion.cs.meta new file mode 100644 index 00000000..afcacff3 --- /dev/null +++ b/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_Automation_TargetInsertion.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 7ddaf4479f8b1b3479deb22865f7a5da diff --git a/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_ManualControlPanelHandler.cs b/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_ManualControlPanelHandler.cs new file mode 100644 index 00000000..8b10c2b8 --- /dev/null +++ b/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_ManualControlPanelHandler.cs @@ -0,0 +1,91 @@ +using System; +using System.Globalization; +using EphysLink; +using UnityEngine; + +namespace Pinpoint.Probes.ManipulatorBehaviorController +{ + public partial class ManipulatorBehaviorController + { + /// + /// Drive the manipulator back to the reference coordinate position. + /// + public async Awaitable MoveBackToReferenceCoordinate() + { + // Set moving state. + IsMoving = true; + + // Set state back to be calibrated if it has been calibrated. + if (ProbeAutomationStateManager.IsCalibrated()) + ProbeAutomationStateManager.SetCalibrated(); + + // Log start of movement. + OutputLog.Log( + new[] + { + "ManualControl", + DateTime.Now.ToString(CultureInfo.InvariantCulture), + "MoveBackToReferenceCoordinate", + ManipulatorID, + "Start" + } + ); + + // Send move command + var setPositionResponse = await CommunicationManager.Instance.SetPosition( + new SetPositionRequest( + ManipulatorID, + ReferenceCoordinateOffset, + AUTOMATIC_MOVEMENT_SPEED + ) + ); + + // Reset moving state. + IsMoving = false; + + // Log end of movement. + OutputLog.Log( + new[] + { + "ManualControl", + DateTime.Now.ToString(CultureInfo.InvariantCulture), + "MoveBackToReferenceCoordinate", + ManipulatorID, + "End" + } + ); + + return !CommunicationManager.HasError(setPositionResponse.Error); + } + + /// + /// Stop the manipulator from returning to the reference coordinate position. + /// + public async void StopReturnToReferenceCoordinate() + { + var stopResponse = await CommunicationManager.Instance.Stop(ManipulatorID); + + // Log and exit if there was an error. + if (!string.IsNullOrEmpty(stopResponse)) + { + Debug.LogError(stopResponse); + return; + } + + // Set probe to be not moving. + IsMoving = false; + + // Log stop event. + OutputLog.Log( + new[] + { + "ManualControl", + DateTime.Now.ToString(CultureInfo.InvariantCulture), + "MoveBackToReferenceCoordinate", + ManipulatorID, + "Stop" + } + ); + } + } +} diff --git a/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_ManualControlPanelHandler.cs.meta b/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_ManualControlPanelHandler.cs.meta new file mode 100644 index 00000000..18e151c0 --- /dev/null +++ b/Assets/Scripts/Pinpoint/Probes/ManipulatorBehaviorController/ManipulatorBehaviorController_ManualControlPanelHandler.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b08b9a4990124b84ca061d931c6651ae \ No newline at end of file diff --git a/Assets/Scripts/Pinpoint/Probes/ProbeAutomationState.cs b/Assets/Scripts/Pinpoint/Probes/ProbeAutomationState.cs new file mode 100644 index 00000000..a26df5d9 --- /dev/null +++ b/Assets/Scripts/Pinpoint/Probes/ProbeAutomationState.cs @@ -0,0 +1,88 @@ +namespace Pinpoint.Probes +{ + /// + /// Drive state in the automation cycle. + /// + public enum ProbeAutomationState + { + /// + /// Initial, uncalibrated state. + /// + IsUncalibrated, + + /// + /// Is calibrated to the reference coordinate. Could be positioned anywhere. + /// + IsCalibrated, + + /// + /// Moving to the target entry coordinate. + /// + DrivingToTargetEntryCoordinate, + + /// + /// At the target entry coordinate. + /// + AtEntryCoordinate, + + /// + /// Calibrated to the Dura; ready for insertion drive. + /// + AtDuraInsert, + + /// + /// Driving to near target depth (insertion drive). + /// + DrivingToNearTarget, + + /// + /// At near target depth (insertion drive). Need to switch to 2/3 speed. + /// + AtNearTargetInsert, + + /// + /// Driving to past target depth (insertion drive). + /// + DrivingToPastTarget, + + /// + /// At past target depth (insertion drive). + /// + AtPastTarget, + + /// + /// Driving back up to target depth (insertion drive). + /// + ReturningToTarget, + + /// + /// At target depth (insertion drive). + /// + AtTarget, + + /// + /// Driving back up to the Dura (exit drive). + /// + ExitingToDura, + + /// + /// At the Dura (exit drive). Should not re-insert. + /// + AtDuraExit, + + /// + /// Driving above the Dura by a safe margin (exit drive). + /// + ExitingToMargin, + + /// + /// At the safe margin above the Dura (exit drive). + /// + AtExitMargin, + + /// + /// Driving back up to the target entry coordinate (exit drive). + /// + ExitingToTargetEntryCoordinate, + } +} diff --git a/Assets/Scripts/Pinpoint/Probes/ProbeAutomationState.cs.meta b/Assets/Scripts/Pinpoint/Probes/ProbeAutomationState.cs.meta new file mode 100644 index 00000000..4e2f2421 --- /dev/null +++ b/Assets/Scripts/Pinpoint/Probes/ProbeAutomationState.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a883806dd4f7fd74d803c2bab7381b31 \ No newline at end of file diff --git a/Assets/Scripts/Pinpoint/Probes/ProbeAutomationStateManager.cs b/Assets/Scripts/Pinpoint/Probes/ProbeAutomationStateManager.cs new file mode 100644 index 00000000..acefc1ee --- /dev/null +++ b/Assets/Scripts/Pinpoint/Probes/ProbeAutomationStateManager.cs @@ -0,0 +1,219 @@ +using System; + +namespace Pinpoint.Probes +{ + /// + /// Define and manage the automation state of a probe. + /// + public class ProbeAutomationStateManager + { + #region Properties + + /// + /// The state of the probe. + /// + public ProbeAutomationState ProbeAutomationState { get; private set; } = + ProbeAutomationState.IsUncalibrated; + + #endregion + + #region Actions + + /// + /// Set the probe's state to be calibrated. + /// + /// This can be set from any state. This is the reset point. + public void SetCalibrated() + { + ProbeAutomationState = ProbeAutomationState.IsCalibrated; + } + + /// + /// Set the probe's state to be driving to the target entry coordinate. + /// + /// Probe is not calibrated or at entry coordinate. + public void SetDrivingToTargetEntryCoordinate() + { + if (!IsCalibrated() && ProbeAutomationState != ProbeAutomationState.AtEntryCoordinate) + throw new InvalidOperationException( + "Cannot set probe to driving to target entry coordinate if it is not calibrated." + ); + + ProbeAutomationState = ProbeAutomationState.DrivingToTargetEntryCoordinate; + } + + /// + /// Set the probe's state to be at the target entry coordinate. + /// + /// Probe is not driving there or exiting to there. + public void SetAtEntryCoordinate() + { + if ( + ProbeAutomationState != ProbeAutomationState.DrivingToTargetEntryCoordinate + && ProbeAutomationState != ProbeAutomationState.ExitingToTargetEntryCoordinate + ) + throw new InvalidOperationException( + "Cannot set probe to entry coordinate if it was not driving there or exiting to there." + ); + + ProbeAutomationState = ProbeAutomationState.AtEntryCoordinate; + } + + /// + /// Set the probe's state to be at the Dura for insertion. + /// + /// Probe is not at the entry coordinate or exiting to Dura. + public void SetAtDuraInsert() + { + if ( + ProbeAutomationState != ProbeAutomationState.AtEntryCoordinate + && ProbeAutomationState != ProbeAutomationState.ExitingToDura + ) + throw new InvalidOperationException( + "Cannot set probe to dura if it was not at the entry coordinate or exiting to Dura." + ); + ProbeAutomationState = ProbeAutomationState.AtDuraInsert; + } + + /// + /// Increment the state according to the normal loop for the insertion cycle. + /// + /// Probe is not in the insertion cycle. + public void IncrementInsertionCycleState() + { + switch (ProbeAutomationState) + { + // Throw exception if required state is not met. + case < ProbeAutomationState.AtDuraInsert + or > ProbeAutomationState.ExitingToTargetEntryCoordinate: + throw new InvalidOperationException( + "Cannot increment the insertion cycle state if the probe is not in the insertion cycle." + ); + + // If exiting to the target entry coordinate, set to the target entry coordinate (end of cycle). + case ProbeAutomationState.ExitingToTargetEntryCoordinate: + ProbeAutomationState = ProbeAutomationState.AtEntryCoordinate; + return; + + // Otherwise, increment state. + default: + ProbeAutomationState++; + break; + } + } + + /// + /// Set the probe's state to be in the next insertion driving state. + /// + /// Probe is not in a state that can go drive. + public void SetToInsertionDrivingState() + { + // Throw exception if required state is not met. + if (!IsInsertable()) + throw new InvalidOperationException( + "Cannot set probe to insertion driving state if it is not at the Dura or inside the brain." + ); + + // Set state. + ProbeAutomationState = ProbeAutomationState switch + { + // States for driving to near target depth. + ProbeAutomationState.AtDuraInsert + or ProbeAutomationState.ExitingToDura + => ProbeAutomationState.DrivingToNearTarget, + + // States for driving to past target. + ProbeAutomationState.AtNearTargetInsert + => ProbeAutomationState.DrivingToPastTarget, + + // States for returning to the target. + ProbeAutomationState.AtPastTarget + => ProbeAutomationState.ReturningToTarget, + + // Do nothing for driving states. + _ => ProbeAutomationState + }; + } + + /// + /// Set the probe's state to be in the next exit driving state. + /// + /// Probe is not in a state that can exit. + public void SetToExitingDrivingState() + { + // Throw exception if required state is not met. + if (!IsExitable()) + throw new InvalidOperationException( + "Cannot set probe to exit driving state if it is not past the Dura." + ); + + // Set state. + ProbeAutomationState = ProbeAutomationState switch + { + // States for Exiting to the Dura. + ProbeAutomationState.AtTarget + or ProbeAutomationState.ReturningToTarget + or ProbeAutomationState.DrivingToPastTarget + or ProbeAutomationState.AtNearTargetInsert + or ProbeAutomationState.DrivingToNearTarget + => ProbeAutomationState.ExitingToDura, + + // States for exiting to margin. + ProbeAutomationState.AtDuraExit + => ProbeAutomationState.ExitingToMargin, + + // States for exiting to target entry coordinate. + ProbeAutomationState.AtExitMargin + => ProbeAutomationState.ExitingToTargetEntryCoordinate, + + // Do nothing for driving states. + _ => ProbeAutomationState + }; + } + + #endregion + + #region Queries + + /// + /// Checks if the probe is past the calibration phase. + /// + /// True if the state is past the calibration phase, false otherwise. + public bool IsCalibrated() + { + return ProbeAutomationState >= ProbeAutomationState.IsCalibrated; + } + + /// + /// Checks if the probe has been to the target entry coordinate. + /// + /// True if the state is past reaching the target entry coordinate, false otherwise. + public bool HasReachedTargetEntryCoordinate() + { + return ProbeAutomationState >= ProbeAutomationState.AtEntryCoordinate; + } + + /// + /// Checks if the probe can be inserted (driven into the brain). + /// + /// Returns true if the probe is calibrated to the Dura and has not exited back out of the Dura. + public bool IsInsertable() + { + return ProbeAutomationState + is >= ProbeAutomationState.AtDuraInsert + and < ProbeAutomationState.AtDuraExit + && ProbeAutomationState != ProbeAutomationState.AtTarget; + } + + /// + /// Checks if the probe can be retracted (drive back out of the brain). + /// + /// Returns true if the probe has gone through/past the Dura. + public bool IsExitable() + { + return ProbeAutomationState > ProbeAutomationState.AtDuraInsert; + } + + #endregion + } +} diff --git a/Assets/Scripts/Pinpoint/Probes/ProbeAutomationStateManager.cs.meta b/Assets/Scripts/Pinpoint/Probes/ProbeAutomationStateManager.cs.meta new file mode 100644 index 00000000..d3d7177b --- /dev/null +++ b/Assets/Scripts/Pinpoint/Probes/ProbeAutomationStateManager.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9146e7c3759810d4ead53231e19eb641 \ No newline at end of file diff --git a/Assets/Scripts/Pinpoint/Probes/ProbeManager.cs b/Assets/Scripts/Pinpoint/Probes/ProbeManager.cs index efea6293..71a2d8f7 100644 --- a/Assets/Scripts/Pinpoint/Probes/ProbeManager.cs +++ b/Assets/Scripts/Pinpoint/Probes/ProbeManager.cs @@ -6,6 +6,7 @@ using BrainAtlas; using EphysLink; using Pinpoint.Probes; +using Pinpoint.Probes.ManipulatorBehaviorController; using UnityEngine; using UnityEngine.Events; using UnityEngine.Serialization; @@ -229,7 +230,7 @@ public List GetProbeUIManagers() /// When true, this Probe will be saved and re-loaded in the scene the next time Pinpoint loads /// public bool Saved { get; set; } - + #endregion #region Unity @@ -904,10 +905,11 @@ public void UpdateSurfacePosition() } } + // TODO: Remove useDV and always use depth. /// /// Calculate the entry coordinate on the brain surface, returns coordIdx /// - /// + /// Whether the surface should be found along the DV axis or depth axis. /// (entryCoordAtlasIdx, probeInBrain) public (Vector3 entryCoordAtlasIdx, bool probeInBrain) CalculateEntryCoordinate( bool useDV = false @@ -1271,12 +1273,12 @@ public static ProbeManagerData ProbeManager2ProbeData(ProbeManager probeManager) data.NumAxes = probeManager.ManipulatorBehaviorController.NumAxes; data.ManipulatorID = probeManager.ManipulatorBehaviorController.ManipulatorID; - data.ZeroCoordOffset = probeManager.ManipulatorBehaviorController.ZeroCoordinateOffset; + data.ZeroCoordOffset = probeManager.ManipulatorBehaviorController.ReferenceCoordinateOffset; data.Dimensions = probeManager.ManipulatorBehaviorController.Dimensions; data.BrainSurfaceOffset = probeManager.ManipulatorBehaviorController.BrainSurfaceOffset; - data.Drop2SurfaceWithDepth = probeManager - .ManipulatorBehaviorController - .IsSetToDropToSurfaceWithDepth; + // data.Drop2SurfaceWithDepth = probeManager + // .ManipulatorBehaviorController + // .IsSetToDropToSurfaceWithDepth; data.IsRightHanded = probeManager.ManipulatorBehaviorController.IsRightHanded; return data; diff --git a/Assets/Scripts/Pinpoint/TP_ProbeQuickSettings.cs b/Assets/Scripts/Pinpoint/TP_ProbeQuickSettings.cs index fa6f4ee9..e175bcf9 100644 --- a/Assets/Scripts/Pinpoint/TP_ProbeQuickSettings.cs +++ b/Assets/Scripts/Pinpoint/TP_ProbeQuickSettings.cs @@ -149,7 +149,7 @@ public void ResetZeroCoordinate() if (ProbeManager.ActiveProbeManager.IsEphysLinkControlled) { _communicationManager.GetPosition(ProbeManager.ActiveProbeManager.ManipulatorBehaviorController.ManipulatorID, - zeroCoordinate => ProbeManager.ActiveProbeManager.ManipulatorBehaviorController.ZeroCoordinateOffset = zeroCoordinate); + zeroCoordinate => ProbeManager.ActiveProbeManager.ManipulatorBehaviorController.ReferenceCoordinateOffset = zeroCoordinate); ProbeManager.ActiveProbeManager.ManipulatorBehaviorController.BrainSurfaceOffset = 0; } else diff --git a/Assets/Scripts/Pinpoint/TrajectoryPlannerManager.cs b/Assets/Scripts/Pinpoint/TrajectoryPlannerManager.cs index 77d62301..74797761 100644 --- a/Assets/Scripts/Pinpoint/TrajectoryPlannerManager.cs +++ b/Assets/Scripts/Pinpoint/TrajectoryPlannerManager.cs @@ -486,10 +486,10 @@ public ProbeManager AddNewProbe(ProbeProperties.ProbeType probeType, ProbeInsert // Repopulate Ephys Link information probeManager.ManipulatorBehaviorController.NumAxes = numAxes; - probeManager.ManipulatorBehaviorController.ZeroCoordinateOffset = zeroCoordinateOffset; + probeManager.ManipulatorBehaviorController.ReferenceCoordinateOffset = zeroCoordinateOffset; probeManager.ManipulatorBehaviorController.BrainSurfaceOffset = brainSurfaceOffset; - probeManager.ManipulatorBehaviorController.IsSetToDropToSurfaceWithDepth = dropToSurfaceWithDepth; - probeManager.ManipulatorBehaviorController.IsSetToDropToSurfaceWithDepth = dropToSurfaceWithDepth; + // probeManager.ManipulatorBehaviorController.IsSetToDropToSurfaceWithDepth = dropToSurfaceWithDepth; + // probeManager.ManipulatorBehaviorController.IsSetToDropToSurfaceWithDepth = dropToSurfaceWithDepth; probeManager.ManipulatorBehaviorController.IsRightHanded = isRightHanded; var communicationManager = GameObject.Find("EphysLink").GetComponent(); diff --git a/Assets/Scripts/Pinpoint/UI/EphysCopilot/InsertionSelectionPanelHandler.cs b/Assets/Scripts/Pinpoint/UI/EphysCopilot/InsertionSelectionPanelHandler.cs index 392c1e26..0dcb48a5 100644 --- a/Assets/Scripts/Pinpoint/UI/EphysCopilot/InsertionSelectionPanelHandler.cs +++ b/Assets/Scripts/Pinpoint/UI/EphysCopilot/InsertionSelectionPanelHandler.cs @@ -5,6 +5,7 @@ using BrainAtlas; using EphysLink; using Pinpoint.Probes; +using Pinpoint.Probes.ManipulatorBehaviorController; using TMPro; using UnityEngine; using UnityEngine.Events; diff --git a/Assets/Scripts/Pinpoint/UI/EphysCopilot/ResetZeroCoordinatePanelHandler.cs b/Assets/Scripts/Pinpoint/UI/EphysCopilot/ResetZeroCoordinatePanelHandler.cs index 77ac413e..ec6b1ac7 100644 --- a/Assets/Scripts/Pinpoint/UI/EphysCopilot/ResetZeroCoordinatePanelHandler.cs +++ b/Assets/Scripts/Pinpoint/UI/EphysCopilot/ResetZeroCoordinatePanelHandler.cs @@ -30,7 +30,7 @@ public void ResetZeroCoordinate() ProbeManager.ManipulatorBehaviorController.ManipulatorID, zeroCoordinate => { - ProbeManager.ManipulatorBehaviorController.ZeroCoordinateOffset = + ProbeManager.ManipulatorBehaviorController.ReferenceCoordinateOffset = zeroCoordinate; ProbeManager.ManipulatorBehaviorController.BrainSurfaceOffset = 0; } @@ -44,7 +44,7 @@ public void ResetZeroCoordinate() DateTime.Now.ToString(CultureInfo.InvariantCulture), "ResetZeroCoordinate", ProbeManager.ManipulatorBehaviorController.ManipulatorID, - ProbeManager.ManipulatorBehaviorController.ZeroCoordinateOffset.ToString() + ProbeManager.ManipulatorBehaviorController.ReferenceCoordinateOffset.ToString() } ); } diff --git a/Assets/Scripts/Pinpoint/UI/EphysLinkSettings/EphysLinkSettings.cs b/Assets/Scripts/Pinpoint/UI/EphysLinkSettings/EphysLinkSettings.cs index a2b01c8d..7e8f6d88 100644 --- a/Assets/Scripts/Pinpoint/UI/EphysLinkSettings/EphysLinkSettings.cs +++ b/Assets/Scripts/Pinpoint/UI/EphysLinkSettings/EphysLinkSettings.cs @@ -20,7 +20,7 @@ public class EphysLinkSettings : MonoBehaviour { #region Constants - private const string EPHYS_LINK_NAME = "EphysLink-v2.0.0b5"; + private const string EPHYS_LINK_NAME = "EphysLink-v2.0.0b7"; private static string EphysLinkExePath => Path.Combine( Application.streamingAssetsPath, @@ -80,9 +80,12 @@ public class EphysLinkSettings : MonoBehaviour private UIManager _uiManager; + [SerializeField] private GameObject _newUI; + #endregion #region Properties + private readonly Dictionary< string, @@ -393,6 +396,11 @@ public void InvokeShouldUpdateProbesListEvent() { ShouldUpdateProbesListEvent.Invoke(); } + + public void ToggleNewUI(bool isEnabled) + { + _newUI.SetActive(isEnabled); + } #endregion diff --git a/Assets/Scripts/Pinpoint/UI/EphysLinkSettings/ManipulatorConnectionPanel.cs b/Assets/Scripts/Pinpoint/UI/EphysLinkSettings/ManipulatorConnectionPanel.cs index a88b5310..56a940d8 100644 --- a/Assets/Scripts/Pinpoint/UI/EphysLinkSettings/ManipulatorConnectionPanel.cs +++ b/Assets/Scripts/Pinpoint/UI/EphysLinkSettings/ManipulatorConnectionPanel.cs @@ -250,7 +250,7 @@ public void OnLinkedProbeSelectionChanged(int value) /// New offset X-axis value public void UpdateZeroCoordinateOffsetX(string newValue) { - _attachedProbe.ManipulatorBehaviorController.ZeroCoordinateOffset = new Vector4( + _attachedProbe.ManipulatorBehaviorController.ReferenceCoordinateOffset = new Vector4( float.Parse(newValue), float.NaN, float.NaN, @@ -264,7 +264,7 @@ public void UpdateZeroCoordinateOffsetX(string newValue) /// New offset Y-axis value public void UpdateZeroCoordinateOffsetY(string newValue) { - _attachedProbe.ManipulatorBehaviorController.ZeroCoordinateOffset = new Vector4( + _attachedProbe.ManipulatorBehaviorController.ReferenceCoordinateOffset = new Vector4( float.NaN, float.Parse(newValue), float.NaN, @@ -278,7 +278,7 @@ public void UpdateZeroCoordinateOffsetY(string newValue) /// New offset Z-axis value public void UpdateZeroCoordinateOffsetZ(string newValue) { - _attachedProbe.ManipulatorBehaviorController.ZeroCoordinateOffset = new Vector4( + _attachedProbe.ManipulatorBehaviorController.ReferenceCoordinateOffset = new Vector4( float.NaN, float.NaN, float.Parse(newValue), @@ -292,7 +292,7 @@ public void UpdateZeroCoordinateOffsetZ(string newValue) /// New offset D-axis value public void UpdateZeroCoordinateOffsetD(string newValue) { - _attachedProbe.ManipulatorBehaviorController.ZeroCoordinateOffset = new Vector4( + _attachedProbe.ManipulatorBehaviorController.ReferenceCoordinateOffset = new Vector4( float.NaN, float.NaN, float.NaN, @@ -303,9 +303,9 @@ public void UpdateZeroCoordinateOffsetD(string newValue) public void UpdateDuraDropDirection(int value) { // Set drop direction on attached probe if it exists - if (_attachedProbe) - _attachedProbe.ManipulatorBehaviorController.IsSetToDropToSurfaceWithDepth = - value == 1; + // if (_attachedProbe) + // _attachedProbe.ManipulatorBehaviorController.IsSetToDropToSurfaceWithDepth = + // value == 1; } private void SetDuraDropInteractable(bool interactable) @@ -349,7 +349,7 @@ public void UpdateManualControlState(bool state) /// /// Return manipulator back to zero coordinate /// - public void ReturnToZeroCoordinate() + public async void ReturnToZeroCoordinate() { // Disable keyboard control _attachedProbe.ProbeController.ManipulatorManualControl = false; @@ -359,27 +359,16 @@ public void ReturnToZeroCoordinate() _stopReturningToZeroCoordinateButtonGameObject.SetActive(true); // Move manipulator back to zero coordinate - _attachedProbe.ManipulatorBehaviorController.MoveBackToZeroCoordinate( - _ => - { - PostMoveAction(); - - // Reset dura drop direction on successful return - _attachedProbe.ManipulatorBehaviorController.BrainSurfaceOffset = 0; - }, - _ => PostMoveAction() - ); - return; - - void PostMoveAction() - { - // Show move button and hide stop button - _returnToZeroCoordinateButtonGameObject.SetActive(true); - _stopReturningToZeroCoordinateButtonGameObject.SetActive(false); - - // Re-enable keyboard control - _attachedProbe.ProbeController.ManipulatorManualControl = true; - } + if (await _attachedProbe.ManipulatorBehaviorController.MoveBackToReferenceCoordinate()) + // Reset dura drop direction on successful return. + _attachedProbe.ManipulatorBehaviorController.BrainSurfaceOffset = 0; + + // Show move button and hide stop button + _returnToZeroCoordinateButtonGameObject.SetActive(true); + _stopReturningToZeroCoordinateButtonGameObject.SetActive(false); + + // Re-enable keyboard control + _attachedProbe.ProbeController.ManipulatorManualControl = true; } public void StopReturningToZeroCoordinate() @@ -413,7 +402,7 @@ private void UpdateProbePropertiesSectionState() { _probePropertiesSection.SetActive(true); UpdateZeroCoordinateOffsetInputFields( - _attachedProbe.ManipulatorBehaviorController.ZeroCoordinateOffset + _attachedProbe.ManipulatorBehaviorController.ReferenceCoordinateOffset ); UpdateBrainSurfaceOffsetInputField( _attachedProbe.ManipulatorBehaviorController.BrainSurfaceOffset diff --git a/Assets/Scripts/UI/AutomationStack.meta b/Assets/Scripts/UI/AutomationStack.meta new file mode 100644 index 00000000..246052d4 --- /dev/null +++ b/Assets/Scripts/UI/AutomationStack.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4746c78f687d0a848a5c30aca67a9c44 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/UI/AutomationStack/AutomationStackHandler.cs b/Assets/Scripts/UI/AutomationStack/AutomationStackHandler.cs new file mode 100644 index 00000000..618f732d --- /dev/null +++ b/Assets/Scripts/UI/AutomationStack/AutomationStackHandler.cs @@ -0,0 +1,241 @@ +using System; +using Pinpoint.Probes; +using Pinpoint.Probes.ManipulatorBehaviorController; +using UI.States; +using UnityEngine; +using UnityEngine.UIElements; + +namespace UI.AutomationStack +{ + /// + /// Automation Stack UI origin class. + /// + /// + /// This script handles getting the components, running UI setup functions, and registering callbacks. + /// + public partial class AutomationStackHandler : MonoBehaviour + { + #region Components + + #region State + + [SerializeField] + private AutomationStackState _state; + + #endregion + + #region UI + + // Document. + [SerializeField] + private UIDocument _uiDocument; + private VisualElement _root => _uiDocument.rootVisualElement; + + // Panels. + private VisualElement _automationStackPanel; + + #region Reference Coordinate Calibration + + private Button _resetReferenceCoordinateButton; + + #endregion + + #region Target Insertion + + private RadioButtonGroup _targetInsertionRadioButtonGroup; + private Button _driveToTargetEntryCoordinateButton; + + #endregion + + #region Dura Calibration + + private Button _resetDuraCalibrationButton; + + #endregion + + #region Insertion + + private Button _driveToTargetInsertionButton; + private Button _stopButton; + private Button _exitButton; + + #endregion + + #endregion + + + #region Probes + + private static ManipulatorBehaviorController ActiveManipulatorBehaviorController => + ProbeManager.ActiveProbeManager.ManipulatorBehaviorController; + + private static ProbeAutomationStateManager ActiveProbeStateManager => + ActiveManipulatorBehaviorController.ProbeAutomationStateManager; + + #endregion + + #endregion + + + #region Unity + + private void OnEnable() + { + // Get components. + _automationStackPanel = _root.Q("automation-stack-panel"); + _resetReferenceCoordinateButton = _automationStackPanel.Q