From 07425c1672739eaa5c6707d30ef6f7f27217a404 Mon Sep 17 00:00:00 2001 From: lachs218 Date: Wed, 21 May 2025 23:09:31 +0200 Subject: [PATCH] Explode Model --- .../Resources/OVROverlayCanvasSettings.asset | 19 + .../OVROverlayCanvasSettings.asset.meta | 8 + .../Assets/Scenes/SampleScene.unity | 928 ++++++++++++++---- .../Assets/Scripts/Models/ModelList.cs | 42 +- .../Assets/Scripts/Models/ModelManager.cs | 18 + vr-configurator/Assets/Scripts/Models/Port.cs | 16 +- .../Assets/Scripts/Transform/ExplodeBike.cs | 47 - .../Scripts/Transform/ExplodeBike.cs.meta | 2 - .../Assets/Scripts/Transform/ExplodeModel.cs | 102 ++ .../Scripts/Transform/ExplodeModel.cs.meta | 2 + .../Scripts/Transform/UnExplodeModel.cs | 27 + .../Scripts/Transform/UnExplodeModel.cs.meta | 2 + .../Assets/Scripts/UI/BaseModelSelector.cs | 51 +- .../Scripts/UI/ReturnButtonBehaviour.cs | 8 +- vr-configurator/export.json | 0 15 files changed, 990 insertions(+), 282 deletions(-) create mode 100644 vr-configurator/Assets/Resources/OVROverlayCanvasSettings.asset create mode 100644 vr-configurator/Assets/Resources/OVROverlayCanvasSettings.asset.meta delete mode 100644 vr-configurator/Assets/Scripts/Transform/ExplodeBike.cs delete mode 100644 vr-configurator/Assets/Scripts/Transform/ExplodeBike.cs.meta create mode 100644 vr-configurator/Assets/Scripts/Transform/ExplodeModel.cs create mode 100644 vr-configurator/Assets/Scripts/Transform/ExplodeModel.cs.meta create mode 100644 vr-configurator/Assets/Scripts/Transform/UnExplodeModel.cs create mode 100644 vr-configurator/Assets/Scripts/Transform/UnExplodeModel.cs.meta create mode 100644 vr-configurator/export.json diff --git a/vr-configurator/Assets/Resources/OVROverlayCanvasSettings.asset b/vr-configurator/Assets/Resources/OVROverlayCanvasSettings.asset new file mode 100644 index 0000000..053537b --- /dev/null +++ b/vr-configurator/Assets/Resources/OVROverlayCanvasSettings.asset @@ -0,0 +1,19 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !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: efa1458c2bc55e04b872c61942be2866, type: 3} + m_Name: OVROverlayCanvasSettings + m_EditorClassIdentifier: + _transparentImposterShader: {fileID: 0} + _opaqueImposterShader: {fileID: 0} + MaxSimultaneousCanvases: 1 + CanvasRenderLayer: 31 + CanvasLayer: -1 diff --git a/vr-configurator/Assets/Resources/OVROverlayCanvasSettings.asset.meta b/vr-configurator/Assets/Resources/OVROverlayCanvasSettings.asset.meta new file mode 100644 index 0000000..867735b --- /dev/null +++ b/vr-configurator/Assets/Resources/OVROverlayCanvasSettings.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cbb9a7449d589c14298d9bcdf4862fcf +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/vr-configurator/Assets/Scenes/SampleScene.unity b/vr-configurator/Assets/Scenes/SampleScene.unity index f171b86..dadefc6 100644 --- a/vr-configurator/Assets/Scenes/SampleScene.unity +++ b/vr-configurator/Assets/Scenes/SampleScene.unity @@ -443,6 +443,142 @@ Transform: - {fileID: 1227652227} m_Father: {fileID: 434687814} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &14989656 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 14989657} + - component: {fileID: 14989659} + - component: {fileID: 14989658} + m_Layer: 0 + m_Name: ReturnButtonText + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &14989657 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 14989656} + 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: 444853961} + 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: 200, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &14989658 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 14989656} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, 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_text: Unexplode + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 24 + m_fontSizeBase: 24 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_TextWrappingMode: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 0 + m_ActiveFontFeatures: 6e72656b + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_EmojiFallbackSupport: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &14989659 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 14989656} + m_CullTransparentMesh: 1 --- !u!1 &29009377 GameObject: m_ObjectHideFlags: 0 @@ -4963,6 +5099,165 @@ Transform: - {fileID: 14937364} m_Father: {fileID: 1793768537} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &444853960 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 444853961} + - component: {fileID: 444853966} + - component: {fileID: 444853965} + - component: {fileID: 444853964} + - component: {fileID: 444853963} + - component: {fileID: 444853962} + m_Layer: 0 + m_Name: UnExplode + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &444853961 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 444853960} + m_LocalRotation: {x: 0.17364816, y: -0, z: -0, w: 0.9848078} + m_LocalPosition: {x: 0, y: 0, z: -20.854225} + m_LocalScale: {x: 0.01, y: 0.01, z: 0.01} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 14989657} + m_Father: {fileID: 525196406} + m_LocalEulerAnglesHint: {x: 20, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 7.712, y: 9.841996} + m_SizeDelta: {x: 180, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &444853962 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 444853960} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 148fd3ba1bc1c7745bd89a67b61c8834, type: 3} + m_Name: + m_EditorClassIdentifier: + go: {fileID: 645201570} + explodeBUtton: {fileID: 465093186} + mm: {fileID: 1519836175} +--- !u!114 &444853963 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 444853960} + 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: 0.21960786, g: 0.21960786, b: 0.21960786, 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: 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!222 &444853964 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 444853960} + m_CullTransparentMesh: 1 +--- !u!65 &444853965 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 444853960} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &444853966 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 444853960} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, 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: 444853963} + m_OnClick: + m_PersistentCalls: + m_Calls: [] --- !u!1 &456915309 GameObject: m_ObjectHideFlags: 0 @@ -5050,6 +5345,165 @@ Transform: m_Children: [] m_Father: {fileID: 2107447216} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &465093186 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 465093193} + - component: {fileID: 465093191} + - component: {fileID: 465093190} + - component: {fileID: 465093189} + - component: {fileID: 465093188} + - component: {fileID: 465093187} + m_Layer: 0 + m_Name: Explode + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &465093187 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 465093186} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3bf62feee29a7fb41b8ec04cfa1231ad, type: 3} + m_Name: + m_EditorClassIdentifier: + mm: {fileID: 1519836175} + go: {fileID: 645201570} + unexplodeButton: {fileID: 444853960} +--- !u!114 &465093188 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 465093186} + 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: 0.21960786, g: 0.21960786, b: 0.21960786, 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: 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!222 &465093189 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 465093186} + m_CullTransparentMesh: 1 +--- !u!65 &465093190 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 465093186} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!114 &465093191 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 465093186} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, 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: 465093188} + m_OnClick: + m_PersistentCalls: + m_Calls: [] +--- !u!224 &465093193 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 465093186} + m_LocalRotation: {x: 0.17364816, y: -0, z: -0, w: 0.9848078} + m_LocalPosition: {x: 0, y: 0, z: -20.854225} + m_LocalScale: {x: 0.01, y: 0.01, z: 0.01} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1785144090} + m_Father: {fileID: 525196406} + m_LocalEulerAnglesHint: {x: 20, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 7.712, y: 9.841996} + m_SizeDelta: {x: 180, y: 50} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &466470436 GameObject: m_ObjectHideFlags: 0 @@ -5737,6 +6191,140 @@ Transform: m_Children: [] m_Father: {fileID: 2002795115} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &525196400 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 525196406} + - component: {fileID: 525196405} + - component: {fileID: 525196404} + - component: {fileID: 525196403} + - component: {fileID: 525196402} + - component: {fileID: 525196401} + m_Layer: 0 + m_Name: CanvasButtons + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!222 &525196401 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 525196400} + m_CullTransparentMesh: 1 +--- !u!114 &525196402 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 525196400} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &525196403 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 525196400} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7aaf960227867044282d921171d2d7ac, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 + pointer: {fileID: 0} + sortOrder: 0 +--- !u!114 &525196404 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 525196400} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 1 +--- !u!223 &525196405 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 525196400} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_VertexColorAlwaysGammaSpace: 0 + m_AdditionalShaderChannelsFlag: 25 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &525196406 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 525196400} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 21.854225} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 576843183} + - {fileID: 465093193} + - {fileID: 444853961} + - {fileID: 1334436260} + m_Father: {fileID: 0} + 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: -9.24393, y: -10.341996} + m_SizeDelta: {x: 100, y: 100} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &527859712 GameObject: m_ObjectHideFlags: 0 @@ -6422,14 +7010,10 @@ GameObject: m_Component: - component: {fileID: 576843183} - component: {fileID: 576843182} - - component: {fileID: 576843191} - - component: {fileID: 576843190} - - component: {fileID: 576843189} - - component: {fileID: 576843188} - - component: {fileID: 576843187} - - component: {fileID: 576843186} - component: {fileID: 576843185} - component: {fileID: 576843184} + - component: {fileID: 576843187} + - component: {fileID: 576843186} m_Layer: 0 m_Name: ReturnButton m_TagString: Untagged @@ -6452,6 +7036,9 @@ MonoBehaviour: bms: {fileID: 624025131} mm: {fileID: 1519836175} ContentUi: {fileID: 6345901854734501745} + _canvasButtons: {fileID: 525196400} + explodeButton: {fileID: 465093186} + unexplodeButton: {fileID: 444853960} --- !u!224 &576843183 RectTransform: m_ObjectHideFlags: 0 @@ -6459,17 +7046,17 @@ RectTransform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 576843181} - m_LocalRotation: {x: 0.17364816, y: 0, z: 0, w: 0.9848078} - m_LocalPosition: {x: 0, y: 0, z: 1} + m_LocalRotation: {x: 0.17364816, y: -0, z: -0, w: 0.9848078} + m_LocalPosition: {x: 0, y: 0, z: -20.854225} m_LocalScale: {x: 0.01, y: 0.01, z: 0.01} m_ConstrainProportionsScale: 0 m_Children: - {fileID: 10963625} - m_Father: {fileID: 0} + m_Father: {fileID: 525196406} m_LocalEulerAnglesHint: {x: 20, 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.5} + m_AnchoredPosition: {x: 9.613, y: 9.841996} m_SizeDelta: {x: 180, y: 50} m_Pivot: {x: 0.5, y: 0.5} --- !u!65 &576843184 @@ -6575,88 +7162,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 576843181} m_CullTransparentMesh: 1 ---- !u!114 &576843188 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 576843181} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 7aaf960227867044282d921171d2d7ac, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 - pointer: {fileID: 0} - sortOrder: 0 ---- !u!114 &576843189 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 576843181} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 ---- !u!114 &576843190 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 576843181} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} - m_Name: - m_EditorClassIdentifier: - m_UiScaleMode: 0 - m_ReferencePixelsPerUnit: 100 - m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0 - m_PhysicalUnit: 3 - m_FallbackScreenDPI: 96 - m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 1 - m_PresetInfoIsWorld: 1 ---- !u!223 &576843191 -Canvas: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 576843181} - m_Enabled: 1 - serializedVersion: 3 - m_RenderMode: 2 - m_Camera: {fileID: 0} - m_PlaneDistance: 100 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingBucketNormalizedSize: 0 - m_VertexColorAlwaysGammaSpace: 0 - m_AdditionalShaderChannelsFlag: 25 - m_UpdateRectTransformForStandalone: 0 - m_SortingLayerID: 0 - m_SortingOrder: 0 - m_TargetDisplay: 0 --- !u!1 &578299011 GameObject: m_ObjectHideFlags: 0 @@ -6988,8 +7493,9 @@ MonoBehaviour: m_EditorClassIdentifier: portSelector: {fileID: 6345901854251329130} modelManager: {fileID: 1519836175} + unexplodeButton: {fileID: 444853960} ContentUi: {fileID: 6345901854734501745} - returnButton: {fileID: 576843182} + _canvasButtons: {fileID: 525196400} --- !u!1 &628967020 GameObject: m_ObjectHideFlags: 0 @@ -13511,16 +14017,12 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 1334436260} - - component: {fileID: 1334436258} - - component: {fileID: 1334436257} - - component: {fileID: 1334436256} - - component: {fileID: 1334436255} - component: {fileID: 1334436254} - component: {fileID: 1334436253} - component: {fileID: 1334436252} - component: {fileID: 1334436251} m_Layer: 0 - m_Name: ExportButtong (TODO MERGE WITH RETURNBUTTONG) + m_Name: ExportButton m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -13641,88 +14143,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1334436250} m_CullTransparentMesh: 1 ---- !u!114 &1334436255 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1334436250} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 7aaf960227867044282d921171d2d7ac, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 - pointer: {fileID: 0} - sortOrder: 0 ---- !u!114 &1334436256 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1334436250} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 ---- !u!114 &1334436257 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1334436250} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} - m_Name: - m_EditorClassIdentifier: - m_UiScaleMode: 0 - m_ReferencePixelsPerUnit: 100 - m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0 - m_PhysicalUnit: 3 - m_FallbackScreenDPI: 96 - m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 1 - m_PresetInfoIsWorld: 1 ---- !u!223 &1334436258 -Canvas: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1334436250} - m_Enabled: 1 - serializedVersion: 3 - m_RenderMode: 2 - m_Camera: {fileID: 0} - m_PlaneDistance: 100 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingBucketNormalizedSize: 0 - m_VertexColorAlwaysGammaSpace: 0 - m_AdditionalShaderChannelsFlag: 25 - m_UpdateRectTransformForStandalone: 0 - m_SortingLayerID: 0 - m_SortingOrder: 0 - m_TargetDisplay: 0 --- !u!224 &1334436260 RectTransform: m_ObjectHideFlags: 0 @@ -13731,16 +14151,16 @@ RectTransform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1334436250} m_LocalRotation: {x: 0.17298737, y: 0.085831694, z: -0.015134441, w: 0.98106027} - m_LocalPosition: {x: 0, y: 0, z: 0.832} - m_LocalScale: {x: 0.01, y: 0.01, z: 0.01} + m_LocalPosition: {x: 0, y: 0, z: -21.022224} + m_LocalScale: {x: 0.009999999, y: 0.009999999, z: 0.010000001} m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1542946158} - m_Father: {fileID: 0} + m_Father: {fileID: 525196406} m_LocalEulerAnglesHint: {x: 20, y: 10, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 1.734, y: -0.488} + m_AnchoredPosition: {x: 11.388, y: 9.853996} m_SizeDelta: {x: 180, y: 50} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &1335548243 @@ -16050,6 +16470,7 @@ MonoBehaviour: baseModelGO: {fileID: 645201570} BaseModelBehaviour: {fileID: 645201572} baseModelSelector: {fileID: 624025131} + childPositions: [] --- !u!4 &1519836176 Transform: m_ObjectHideFlags: 0 @@ -19071,6 +19492,142 @@ Transform: - {fileID: 2033891090} m_Father: {fileID: 2019843967} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1785144089 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1785144090} + - component: {fileID: 1785144092} + - component: {fileID: 1785144091} + m_Layer: 0 + m_Name: ReturnButtonText + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1785144090 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1785144089} + 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: 465093193} + 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: 200, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1785144091 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1785144089} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, 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_text: Explode + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 24 + m_fontSizeBase: 24 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_TextWrappingMode: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 0 + m_ActiveFontFeatures: 6e72656b + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_EmojiFallbackSupport: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &1785144092 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1785144089} + m_CullTransparentMesh: 1 --- !u!1 &1793768536 GameObject: m_ObjectHideFlags: 0 @@ -27018,7 +27575,6 @@ SceneRoots: - {fileID: 1611507763} - {fileID: 4993107373397872358} - {fileID: 1519836176} - - {fileID: 576843183} - {fileID: 624025130} - {fileID: 6345901854734501750} - - {fileID: 1334436260} + - {fileID: 525196406} diff --git a/vr-configurator/Assets/Scripts/Models/ModelList.cs b/vr-configurator/Assets/Scripts/Models/ModelList.cs index 5d044f0..0ae9718 100644 --- a/vr-configurator/Assets/Scripts/Models/ModelList.cs +++ b/vr-configurator/Assets/Scripts/Models/ModelList.cs @@ -113,26 +113,26 @@ public class ModelList new Port(Definitions.PORT_ERLBACH_71, new Vector3(0f, 0f, 0f), "idErlbachPart71", false), new Port(Definitions.PORT_ERLBACH_72, new Vector3(0f, 0f, 0f), "idErlbachPart72", false), new Port(Definitions.PORT_ERLBACH_73, new Vector3(0f, 0f, 0f), "idErlbachPart73", false), - new Port(Definitions.PORT_ERLBACH_BasePlate, new Vector3(0f, 0f, 0f), "idErlbachPart74"), - new Port(Definitions.PORT_ERLBACH_FrontAxe, new Vector3(0f, 0f, 0f), "idErlbachPart75"), - new Port(Definitions.PORT_ERLBACH_BatteriePack, new Vector3(0f, 0f, 0f), "idErlbachPart76"), + new Port(Definitions.PORT_ERLBACH_BasePlate, new Vector3(0f, 0f, 0f), "idErlbachPart74",true, new Vector3(0f,0f,0f)), + new Port(Definitions.PORT_ERLBACH_FrontAxe, new Vector3(0f, 0f, 0f), "idErlbachPart75",true, new Vector3(1f,0f,0f)), + new Port(Definitions.PORT_ERLBACH_BatteriePack, new Vector3(0f, 0f, 0f), "idErlbachPart76",true, new Vector3(0f,0f,1f)), new Port(Definitions.PORT_ERLBACH_77, new Vector3(0f, 0f, 0f), "idErlbachPart77", false), new Port(Definitions.PORT_ERLBACH_78, new Vector3(0f, 0f, 0f), "idErlbachPart78", false), new Port(Definitions.PORT_ERLBACH_79, new Vector3(0f, 0f, 0f), "idErlbachPart79", false), - new Port(Definitions.PORT_ERLBACH_Wheel, new Vector3(0f, 0f, 0f), "idErlbachWheel_LH"), - new Port(Definitions.PORT_ERLBACH_Wheel, new Vector3(0f, 0f, 0f), "idErlbachWheel_LV"), - new Port(Definitions.PORT_ERLBACH_Wheel, new Vector3(0f, 0f, 0f), "idErlbachWheel_RH"), - new Port(Definitions.PORT_ERLBACH_Wheel, new Vector3(0f, 0f, 0f), "idErlbachWheel_RV"), - new Port(Definitions.PORT_ERLBACH_Body, new Vector3(0f, 0f, 0f), "idErlbachPart84"), - new Port(Definitions.PORT_ERLBACH_Bumper, new Vector3(0f, 0f, 0f), "idErlbachPart85"), - new Port(Definitions.PORT_ERLBACH_FrontBumper, new Vector3(0f, 0f, 0f), "idErlbachPart86"), - new Port(Definitions.PORT_ERLBACH_Number, new Vector3(0f, 0f, 0f), "idErlbachPart87"), - new Port(Definitions.PORT_ERLBACH_LicensePlate, new Vector3(0f, 0f, 0f), "idErlbachPart88"), - new Port(Definitions.PORT_ERLBACH_LicensePlateContent, new Vector3(0f, 0f, 0f), "idErlbachPart89"), - new Port(Definitions.PORT_ERLBACH_Grill, new Vector3(0f, 0f, 0f), "idErlbachPart90"), - new Port(Definitions.PORT_ERLBACH_Refelctor_H, new Vector3(0f, 0f, 0f), "idErlbachPart91"), - new Port(Definitions.PORT_ERLBACH_Headlight_V_Cover, new Vector3(0f, 0f, 0f), "idErlbachPart92"), - new Port(Definitions.PORT_ERLBACH_Headlight_V, new Vector3(0f, 0f, 0f), "idErlbachPart93") + new Port(Definitions.PORT_ERLBACH_Wheel, new Vector3(0f, 0f, 0f), "idErlbachWheel_LH", true, new Vector3(0f,-1f,0f)), + new Port(Definitions.PORT_ERLBACH_Wheel, new Vector3(0f, 0f, 0f), "idErlbachWheel_LV",true, new Vector3(0f,-1f,0f)), + new Port(Definitions.PORT_ERLBACH_Wheel, new Vector3(0f, 0f, 0f), "idErlbachWheel_RH",true, new Vector3(0f,1f,0f)), + new Port(Definitions.PORT_ERLBACH_Wheel, new Vector3(0f, 0f, 0f), "idErlbachWheel_RV",true, new Vector3(0f,1f,0f)), + new Port(Definitions.PORT_ERLBACH_Body, new Vector3(0f, 0f, 0f), "idErlbachPart84",true, new Vector3(0f,0f,1f)), + new Port(Definitions.PORT_ERLBACH_Bumper, new Vector3(0f, 0f, 0f), "idErlbachPart85",true, new Vector3(1f,0f,0f)), + new Port(Definitions.PORT_ERLBACH_FrontBumper, new Vector3(0f, 0f, 0f), "idErlbachPart86",true, new Vector3(-1f,0f,0f)), + new Port(Definitions.PORT_ERLBACH_Number, new Vector3(0f, 0f, 0f), "idErlbachPart87",true, new Vector3(1f,0f,0f)), + new Port(Definitions.PORT_ERLBACH_LicensePlate, new Vector3(0f, 0f, 0f), "idErlbachPart88",true, new Vector3(1f,0f,0f)), + new Port(Definitions.PORT_ERLBACH_LicensePlateContent, new Vector3(0f, 0f, 0f), "idErlbachPart89",true, new Vector3(1f,0f,0f)), + new Port(Definitions.PORT_ERLBACH_Grill, new Vector3(0f, 0f, 0f), "idErlbachPart90",true, new Vector3(-1f,0f,0f)), + new Port(Definitions.PORT_ERLBACH_Refelctor_H, new Vector3(0f, 0f, 0f), "idErlbachPart91",true, new Vector3(1f,0f,0f)), + new Port(Definitions.PORT_ERLBACH_Headlight_V_Cover, new Vector3(0f, 0f, 0f), "idErlbachPart92",true, new Vector3(-1f,0f,0f)), + new Port(Definitions.PORT_ERLBACH_Headlight_V, new Vector3(0f, 0f, 0f), "idErlbachPart93",true, new Vector3(-1f,0f,0f)) } ) }; @@ -177,6 +177,14 @@ public class ModelList Resources.Load("Plagues/Mesh/Hex"), Resources.Load($"Material/Default"), null + ), + new ChildModel( + Definitions.PORT_ERLBACH_Wheel, + "Wheel", + "rad20", + Resources.Load($"Model/ERLbach/02.01.05.0000-Rad_5Speichen"), + Resources.Load($"Material/Default"), + null ) }; diff --git a/vr-configurator/Assets/Scripts/Models/ModelManager.cs b/vr-configurator/Assets/Scripts/Models/ModelManager.cs index ab0421d..68c5b32 100644 --- a/vr-configurator/Assets/Scripts/Models/ModelManager.cs +++ b/vr-configurator/Assets/Scripts/Models/ModelManager.cs @@ -17,6 +17,7 @@ public class ModelManager : MonoBehaviour } public BaseModelBehaviour BaseModelBehaviour; public BaseModelSelector baseModelSelector; + public List childPositions = new List(); // Start is called once before the first execution of Update after the MonoBehaviour is created void Start() @@ -153,5 +154,22 @@ public class ModelManager : MonoBehaviour tw.Write(BaseModelBehaviour.ExportJson()); tw.Close(); } + public Port GetPortForChildModel(ChildModel childModel) + { + foreach (var port in BaseModel.Ports) + { + var childModels = GetChildModelsForPort(port.PortID); + if (childModels.Contains(childModel)) + { + if (port.DefaultId == childModel.NameId) + { + return port; + } + + } + } + Debug.LogWarning($"Kein Port für das ChildModel {childModel.NameId} gefunden."); + return null; + } } diff --git a/vr-configurator/Assets/Scripts/Models/Port.cs b/vr-configurator/Assets/Scripts/Models/Port.cs index ef55791..b1bba8b 100644 --- a/vr-configurator/Assets/Scripts/Models/Port.cs +++ b/vr-configurator/Assets/Scripts/Models/Port.cs @@ -8,6 +8,7 @@ public class Port public readonly string PortID; // port name public readonly string DefaultId; //the default ChildModel to apply on initialization public readonly bool Chooseable; //whether the Port will be rendered in GUI + public readonly Vector3 direction; public void Apply(Transform target) @@ -17,7 +18,7 @@ public class Port target.localScale = _scale; } - public Port(string name, Vector3 position, string defaultId, bool chooseable = true) + public Port(string name, Vector3 position, string defaultId, bool chooseable = true, Vector3 direction = default) { PortID = name; this._position = position; @@ -25,9 +26,11 @@ public class Port this._scale = new Vector3(1f,1f,1f); this.DefaultId = defaultId; this.Chooseable = chooseable; + + this.direction = direction; } - public Port(string portID, Vector3 position, Quaternion rotation, Vector3 scale, string defaultId, bool chooseable = true) + public Port(string portID, Vector3 position, Quaternion rotation, Vector3 scale, string defaultId, bool chooseable = true,Vector3 direction = default) { this.PortID = portID; this._position = position; @@ -35,8 +38,10 @@ public class Port this._scale = scale; this.DefaultId = defaultId; this.Chooseable = chooseable; + this.direction = direction; } - public Port(string portID, Vector3 position, Quaternion rotation, string defaultId, bool chooseable = true) + public Port(string portID, Vector3 position, Quaternion rotation, string defaultId, bool chooseable = true, Vector3 direction = default) + { this.PortID = portID; this._position = position; @@ -44,6 +49,11 @@ public class Port this._scale = new Vector3(1f,1f,1f); this.DefaultId = defaultId; this.Chooseable = chooseable; + this.direction = direction; + } + public Vector3 GetPosition() + { + return _position; } } diff --git a/vr-configurator/Assets/Scripts/Transform/ExplodeBike.cs b/vr-configurator/Assets/Scripts/Transform/ExplodeBike.cs deleted file mode 100644 index 79a967a..0000000 --- a/vr-configurator/Assets/Scripts/Transform/ExplodeBike.cs +++ /dev/null @@ -1,47 +0,0 @@ -using UnityEngine; - -public class ExplodeBike : MonoBehaviour -{ - [System.Serializable] - public class BikePart - { - public Transform part; - public Vector3 explodeDirection; - } - - public BikePart[] bikeParts; - public float explosionDistance = 2f; - public float explosionSpeed = 2f; - private bool _isExploding = false; - - private Vector3[] _originalPositions; - - void Start() - { - _originalPositions = new Vector3[bikeParts.Length]; - for (int i = 0; i < bikeParts.Length; i++) - { - _originalPositions[i] = bikeParts[i].part.localPosition; - } - } - - void Update() - { - if (_isExploding) - { - for (int i = 0; i < bikeParts.Length; i++) - { - Vector3 targetPos = _originalPositions[i] + - bikeParts[i].explodeDirection.normalized * explosionDistance; - bikeParts[i].part.localPosition = Vector3 - .Lerp(bikeParts[i].part.localPosition, targetPos, Time.deltaTime * explosionSpeed); - } - } - } - - public void Explode() - { - _isExploding = true; - } - -} diff --git a/vr-configurator/Assets/Scripts/Transform/ExplodeBike.cs.meta b/vr-configurator/Assets/Scripts/Transform/ExplodeBike.cs.meta deleted file mode 100644 index 7e9d04a..0000000 --- a/vr-configurator/Assets/Scripts/Transform/ExplodeBike.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 70b47230a8a0a8a459511d787cd6a722 \ No newline at end of file diff --git a/vr-configurator/Assets/Scripts/Transform/ExplodeModel.cs b/vr-configurator/Assets/Scripts/Transform/ExplodeModel.cs new file mode 100644 index 0000000..e684b86 --- /dev/null +++ b/vr-configurator/Assets/Scripts/Transform/ExplodeModel.cs @@ -0,0 +1,102 @@ +using System; +using System.Collections.Generic; +using Unity.VisualScripting; +using UnityEngine; +using UnityEngine.UI; + +public class ExplodeModel : MonoBehaviour +{ + + public ModelManager mm; + public GameObject go; + public GameObject unexplodeButton; + + private float y; + private float z; + private float x; + + + void Start() + { + GetComponent