From 3a20deefe3aca0634ec742d2e8ab3b956e08557d Mon Sep 17 00:00:00 2001 From: Marius Kern <mariusskern@gmail.com> Date: Mon, 12 Aug 2024 16:14:06 +0200 Subject: [PATCH] Rectangle fixed --- .../Resources/Prefabs/Facts/Rectangle.prefab | 607 ++++++++++++------ .../Prefabs/Facts/Rectangle.prefab.meta | 7 +- Assets/Scenes/Worlds/RiverWorld.unity | 2 +- .../FactHandling/FactSpawner.cs | 17 +- .../FactHandling/Facts/RectangleFact.cs | 17 +- 5 files changed, 459 insertions(+), 191 deletions(-) diff --git a/Assets/Resources/Prefabs/Facts/Rectangle.prefab b/Assets/Resources/Prefabs/Facts/Rectangle.prefab index 518ca03a..ab24ebaf 100644 --- a/Assets/Resources/Prefabs/Facts/Rectangle.prefab +++ b/Assets/Resources/Prefabs/Facts/Rectangle.prefab @@ -1,6 +1,6 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!1 &6839596689016440457 +--- !u!1 &2688299870578515406 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -8,79 +8,309 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 3390467403729316765} - - component: {fileID: 1812690906255965161} - - component: {fileID: 6950663371922587874} + - component: {fileID: 29302832430599646} + - component: {fileID: 503893222331825355} + - component: {fileID: 661528896933927744} + - component: {fileID: 3021905677247651873} m_Layer: 23 - m_Name: Rectangle - m_TagString: Selectable + m_Name: LabelText + m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &3390467403729316765 -Transform: +--- !u!224 &29302832430599646 +RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6839596689016440457} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_GameObject: {fileID: 2688299870578515406} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.25} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 1 - m_Children: - - {fileID: 2727348597328184922} - - {fileID: 6990040153469839674} - - {fileID: 6662482376097614856} - m_Father: {fileID: 0} - m_RootOrder: 0 + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3390467403729316765} + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1812690906255965161 + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0.5, y: 0.5} + m_SizeDelta: {x: 2, y: 0.5} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!23 &503893222331825355 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2688299870578515406} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!114 &661528896933927744 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6839596689016440457} + m_GameObject: {fileID: 2688299870578515406} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 405087c38b8537e43bcc99727c5325ec, type: 3} + m_Script: {fileID: 11500000, guid: 9541d86e2fd84c1d9990edf0852d74ab, type: 3} m_Name: m_EditorClassIdentifier: - Meshs: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - NormalOffset: [] - AlternateNormals: 0 - radius: 1 - sideCount: 500 ---- !u!114 &6950663371922587874 + 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: Test + 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: 4 + m_fontSizeBase: 4 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 256 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 0 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 1 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 + m_hasFontAssetChanged: 0 + m_renderer: {fileID: 503893222331825355} + m_maskType: 0 +--- !u!114 &3021905677247651873 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 6839596689016440457} + m_GameObject: {fileID: 2688299870578515406} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8cf5a358dacd3b54ab093ee289dd9ba2, type: 3} + m_Name: + m_EditorClassIdentifier: + Cam1: {fileID: 0} + Cam2: {fileID: 0} + BackUPCam: {fileID: 0} +--- !u!1 &3319392661904935552 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7541265271928914416} + - component: {fileID: 1312883106029576503} + - component: {fileID: 5284903402926663935} + - component: {fileID: 2574848627300415222} + - component: {fileID: 7280041197286401157} + m_Layer: 23 + m_Name: Mesh Down + m_TagString: SnapZone + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7541265271928914416 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3319392661904935552} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.01} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 6787775389045427190} + m_Father: {fileID: 3390467403729316765} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &1312883106029576503 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3319392661904935552} + m_Mesh: {fileID: 0} +--- !u!23 &5284903402926663935 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3319392661904935552} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 8ae9adf4dc782964387385c1e8c0eb72, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!64 &2574848627300415222 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3319392661904935552} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 0} +--- !u!114 &7280041197286401157 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3319392661904935552} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 626c435b76e0d334f959ede8b54b07ac, type: 3} m_Name: m_EditorClassIdentifier: _URI: - FactText: - - {fileID: 7177577245137766670} + FactText: [] StringLabelFormats: [] Default: {fileID: 2100000, guid: 8ae9adf4dc782964387385c1e8c0eb72, type: 2} Selected: {fileID: 2100000, guid: 34a95baef388bb8458c97a626b732f9f, type: 2} Hint: {fileID: 2100000, guid: 8621b710d7d1d5041bc6bfd0cc37cdff, type: 2} Solution: {fileID: 2100000, guid: 2a003f0807acc1142965bb21bdc824f6, type: 2} renderer: - - {fileID: 6517075380011649605} - - {fileID: 5361971246579526846} ---- !u!1 &7399997364077007465 + - {fileID: 5284903402926663935} + - {fileID: 1078883255209641429} +--- !u!1 &4682201382595328041 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -88,46 +318,46 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 6990040153469839674} - - component: {fileID: 8042990558578607756} - - component: {fileID: 5361971246579526846} + - component: {fileID: 6787775389045427190} + - component: {fileID: 6626359674163989219} + - component: {fileID: 4818731436791451552} m_Layer: 23 - m_Name: PlaneDown + m_Name: TriangleHighlight m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &6990040153469839674 +--- !u!4 &6787775389045427190 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7399997364077007465} - m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: -0.01} - m_LocalScale: {x: 0.2, y: 0.0009999999, z: 0.20000002} + m_GameObject: {fileID: 4682201382595328041} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.96, y: 1, z: 0.96} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 3390467403729316765} - m_RootOrder: 1 + m_Father: {fileID: 7541265271928914416} + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!33 &8042990558578607756 +--- !u!33 &6626359674163989219 MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7399997364077007465} - m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} ---- !u!23 &5361971246579526846 + m_GameObject: {fileID: 4682201382595328041} + m_Mesh: {fileID: 0} +--- !u!23 &4818731436791451552 MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7399997364077007465} + m_GameObject: {fileID: 4682201382595328041} m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 @@ -163,7 +393,7 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} ---- !u!1 &8598638540628061046 +--- !u!1 &5866155945383417828 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -171,46 +401,46 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 2727348597328184922} - - component: {fileID: 3597909010427076542} - - component: {fileID: 6517075380011649605} + - component: {fileID: 8554957501859850914} + - component: {fileID: 3164742056485930267} + - component: {fileID: 1460740696286669547} m_Layer: 23 - m_Name: PlaneUp + m_Name: TriangleHighlight m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &2727348597328184922 +--- !u!4 &8554957501859850914 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8598638540628061046} - m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068} - m_LocalPosition: {x: 0, y: 0, z: 0.01} - m_LocalScale: {x: 0.2, y: 0.0009999999, z: 0.20000002} + m_GameObject: {fileID: 5866155945383417828} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.96, y: 1, z: 0.96} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 3390467403729316765} + m_Father: {fileID: 142224692930156368} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!33 &3597909010427076542 +--- !u!33 &3164742056485930267 MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8598638540628061046} - m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} ---- !u!23 &6517075380011649605 + m_GameObject: {fileID: 5866155945383417828} + m_Mesh: {fileID: 0} +--- !u!23 &1460740696286669547 MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8598638540628061046} + m_GameObject: {fileID: 5866155945383417828} m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 @@ -246,7 +476,7 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} ---- !u!1 &8645286316326201467 +--- !u!1 &6262947649539239553 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -254,47 +484,52 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 6662482376097614856} - - component: {fileID: 5986843358289336505} - - component: {fileID: 7177577245137766670} - - component: {fileID: 2586578973517344970} + - component: {fileID: 142224692930156368} + - component: {fileID: 7167210412035754299} + - component: {fileID: 1078883255209641429} + - component: {fileID: 8526453253978894086} + - component: {fileID: -7239156242830623982} m_Layer: 23 - m_Name: LabelText - m_TagString: Untagged + m_Name: Mesh Up + m_TagString: SnapZone m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &6662482376097614856 -RectTransform: +--- !u!4 &142224692930156368 +Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8645286316326201467} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0.4} + m_GameObject: {fileID: 6262947649539239553} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0.01} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 - m_Children: [] + m_Children: + - {fileID: 8554957501859850914} m_Father: {fileID: 3390467403729316765} - m_RootOrder: 2 + m_RootOrder: 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: 0, y: 0} - m_SizeDelta: {x: 2, y: 0.5} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!23 &5986843358289336505 +--- !u!33 &7167210412035754299 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6262947649539239553} + m_Mesh: {fileID: 0} +--- !u!23 &1078883255209641429 MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8645286316326201467} + m_GameObject: {fileID: 6262947649539239553} m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 + m_CastShadows: 1 + m_ReceiveShadows: 1 m_DynamicOccludee: 1 m_StaticShadowCaster: 0 m_MotionVectors: 1 @@ -305,7 +540,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - - {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + - {fileID: 2100000, guid: 8ae9adf4dc782964387385c1e8c0eb72, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -327,110 +562,118 @@ MeshRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_AdditionalVertexStreams: {fileID: 0} ---- !u!114 &7177577245137766670 +--- !u!64 &8526453253978894086 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6262947649539239553} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 1 + m_CookingOptions: 30 + m_Mesh: {fileID: 0} +--- !u!114 &-7239156242830623982 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8645286316326201467} + m_GameObject: {fileID: 6262947649539239553} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 9541d86e2fd84c1d9990edf0852d74ab, type: 3} + m_Script: {fileID: 11500000, guid: 626c435b76e0d334f959ede8b54b07ac, 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: Test - 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: 4 - m_fontSizeBase: 4 - m_fontWeight: 400 - m_enableAutoSizing: 0 - m_fontSizeMin: 18 - m_fontSizeMax: 72 - m_fontStyle: 0 - m_HorizontalAlignment: 2 - m_VerticalAlignment: 256 - m_textAlignment: 65535 - m_characterSpacing: 0 - m_wordSpacing: 0 - m_lineSpacing: 0 - m_lineSpacingMax: 0 - m_paragraphSpacing: 0 - m_charWidthMaxAdj: 0 - m_enableWordWrapping: 1 - m_wordWrappingRatios: 0.4 - m_overflowMode: 0 - m_linkedTextComponent: {fileID: 0} - parentLinkedComponent: {fileID: 0} - m_enableKerning: 1 - m_enableExtraPadding: 0 - checkPaddingRequired: 0 - m_isRichText: 1 - m_parseCtrlCharacters: 1 - m_isOrthographic: 0 - m_isCullingEnabled: 0 - m_horizontalMapping: 0 - m_verticalMapping: 0 - m_uvLineOffset: 0 - m_geometrySortingOrder: 0 - m_IsTextObjectScaleStatic: 0 - m_VertexBufferAutoSizeReduction: 1 - m_useMaxVisibleDescender: 1 - m_pageToDisplay: 1 - m_margin: {x: 0, y: 0, z: 0, w: 0} - m_isUsingLegacyAnimationComponent: 0 - m_isVolumetricText: 0 - _SortingLayer: 0 - _SortingLayerID: 0 - _SortingOrder: 0 - m_hasFontAssetChanged: 0 - m_renderer: {fileID: 5986843358289336505} - m_maskType: 0 ---- !u!114 &2586578973517344970 + _URI: + FactText: [] + StringLabelFormats: [] + Default: {fileID: 2100000, guid: 8ae9adf4dc782964387385c1e8c0eb72, type: 2} + Selected: {fileID: 2100000, guid: 34a95baef388bb8458c97a626b732f9f, type: 2} + Hint: {fileID: 2100000, guid: 8621b710d7d1d5041bc6bfd0cc37cdff, type: 2} + Solution: {fileID: 2100000, guid: 2a003f0807acc1142965bb21bdc824f6, type: 2} + renderer: + - {fileID: 1078883255209641429} + - {fileID: 5284903402926663935} +--- !u!1 &6839596689016440457 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3390467403729316765} + - component: {fileID: 6950663371922587874} + - component: {fileID: 1782842647171587099} + m_Layer: 23 + m_Name: Rectangle + m_TagString: Selectable + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3390467403729316765 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6839596689016440457} + 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: 142224692930156368} + - {fileID: 7541265271928914416} + - {fileID: 29302832430599646} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &6950663371922587874 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6839596689016440457} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 626c435b76e0d334f959ede8b54b07ac, type: 3} + m_Name: + m_EditorClassIdentifier: + _URI: + FactText: + - {fileID: 0} + StringLabelFormats: [] + Default: {fileID: 2100000, guid: 8ae9adf4dc782964387385c1e8c0eb72, type: 2} + Selected: {fileID: 2100000, guid: 34a95baef388bb8458c97a626b732f9f, type: 2} + Hint: {fileID: 2100000, guid: 8621b710d7d1d5041bc6bfd0cc37cdff, type: 2} + Solution: {fileID: 2100000, guid: 2a003f0807acc1142965bb21bdc824f6, type: 2} + renderer: + - {fileID: 1078883255209641429} +--- !u!114 &1782842647171587099 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8645286316326201467} + m_GameObject: {fileID: 6839596689016440457} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8cf5a358dacd3b54ab093ee289dd9ba2, type: 3} + m_Script: {fileID: 11500000, guid: 07751329564032247ae66477c3d5d600, type: 3} m_Name: m_EditorClassIdentifier: - Cam1: {fileID: 0} - Cam2: {fileID: 0} - BackUPCam: {fileID: 0} + Meshs: + - {fileID: 7167210412035754299} + - {fileID: 3164742056485930267} + - {fileID: 1312883106029576503} + - {fileID: 6626359674163989219} + NormalOffset: [] + AlternateNormals: 0 + _ab: 1 + _bc: 1 diff --git a/Assets/Resources/Prefabs/Facts/Rectangle.prefab.meta b/Assets/Resources/Prefabs/Facts/Rectangle.prefab.meta index 5eabbfcf..b6ac712c 100644 --- a/Assets/Resources/Prefabs/Facts/Rectangle.prefab.meta +++ b/Assets/Resources/Prefabs/Facts/Rectangle.prefab.meta @@ -1,11 +1,6 @@ fileFormatVersion: 2 -<<<<<<<< HEAD:Assets/Resources/Prefabs/Facts/Square.prefab.meta -guid: a902fb8d5e61cc24ca5ec879e6542ee0 +guid: 07bd5d38ff6a8324485a9509b7fd58ff PrefabImporter: -======== -guid: ffa3cc5a8ea56dc4b8c5e907de1f715a -DefaultImporter: ->>>>>>>> master:Assets/StreamingAssets/StreamToPersistentDataPath/Config/Network_Backup_withAuto.JSON.meta externalObjects: {} userData: assetBundleName: diff --git a/Assets/Scenes/Worlds/RiverWorld.unity b/Assets/Scenes/Worlds/RiverWorld.unity index 3fa0e126..a558c886 100644 --- a/Assets/Scenes/Worlds/RiverWorld.unity +++ b/Assets/Scenes/Worlds/RiverWorld.unity @@ -60891,7 +60891,7 @@ PrefabInstance: type: 3} propertyPath: Rectangle value: - objectReference: {fileID: 6839596689016440457, guid: a902fb8d5e61cc24ca5ec879e6542ee0, + objectReference: {fileID: 6839596689016440457, guid: 07bd5d38ff6a8324485a9509b7fd58ff, type: 3} - target: {fileID: 2872381745209199267, guid: b07552db700124a4680401e6fb94c186, type: 3} diff --git a/Assets/Scripts/InteractionEngine/FactHandling/FactSpawner.cs b/Assets/Scripts/InteractionEngine/FactHandling/FactSpawner.cs index cdd4cc63..7396ce73 100644 --- a/Assets/Scripts/InteractionEngine/FactHandling/FactSpawner.cs +++ b/Assets/Scripts/InteractionEngine/FactHandling/FactSpawner.cs @@ -127,7 +127,7 @@ public void SpawnSphere(SphereFact fact){ } public void SpawnRectangle(RectangleFact fact){ - + /* GameObject rectangle = GameObject.Instantiate(Rectangle); fact.WorldRepresentation = rectangle.GetComponent<FactObject3D>(); @@ -136,7 +136,22 @@ public void SpawnRectangle(RectangleFact fact){ rectangle.transform.SetPositionAndRotation(fact.Position, fact.Rotation); rectangle.transform.localScale = Vector3.Scale(rectangle.transform.localScale, fact.LocalScale); rectangle.GetComponentInChildren<TextMeshPro>().text = fact.GetLabel(StageStatic.stage.factState) + " = " + System.Math.Round(fact.Area, 2) + "m²"; + */ + + GameObject rectangle = GameObject.Instantiate(Rectangle); + fact.WorldRepresentation = rectangle.GetComponent<FactObject3D>(); + fact.WorldRepresentation.Fact = fact; + + rectangle.transform.SetPositionAndRotation(fact.Position, fact.Rotation); + // triangle.transform.localScale = Vector3.Scale(triangle.transform.localScale, fact.LocalScale); + rectangle.GetComponentInChildren<TextMeshPro>().text = fact.GetLabel(StageStatic.stage.factState) + " = " + System.Math.Round(fact.Area, 2) + "m²"; + RectangleGenerator[] rectangleGenerators = rectangle.GetComponentsInChildren<RectangleGenerator>(); + foreach (var gen in rectangleGenerators) + { + gen.ab = Vector3.Distance(fact.A, fact.B); + gen.bc = Vector3.Distance(fact.B, fact.C); + } } public void SpawnSimpleCircle(SimpleCircleFact fact){ diff --git a/Assets/Scripts/InteractionEngine/FactHandling/Facts/RectangleFact.cs b/Assets/Scripts/InteractionEngine/FactHandling/Facts/RectangleFact.cs index e53aae6e..8bb45240 100644 --- a/Assets/Scripts/InteractionEngine/FactHandling/Facts/RectangleFact.cs +++ b/Assets/Scripts/InteractionEngine/FactHandling/Facts/RectangleFact.cs @@ -34,6 +34,8 @@ protected void calculate_vectors(){ Area = (Vector3.Distance(A, B) * Vector3.Distance(B, C)); + + /* Vector3 scale = new Vector3(Vector3.Distance(B, C), Vector3.Distance(A, B), 1.0F); LocalScale = scale * 0.5F; @@ -66,7 +68,20 @@ protected void calculate_vectors(){ Rotation = Quaternion.LookRotation(cross, Vector3.up); } //Rotation = Quaternion.LookRotation(forward, new Vector3(1.0F, 0.0F, 0.0F)); - + */ + + + Position = B; + + Vector3 forward = Vector3.Cross((C - B), (A - B)); + Vector3 up = A - B; + + if ((A - B).y < 0) + { + up = -up; + } + + Rotation = Quaternion.LookRotation(forward, up); } public RectangleFact() : base(){ -- GitLab