diff --git a/Assets/Resources/Prefabs/Facts/Circle.prefab b/Assets/Resources/Prefabs/Facts/Circle.prefab index 08ee28ea7a16a771a3feaf96954cf72638c650bb..33c93678e7db9d94c6a7f91f8df2450921a1e208 100644 --- a/Assets/Resources/Prefabs/Facts/Circle.prefab +++ b/Assets/Resources/Prefabs/Facts/Circle.prefab @@ -1,270 +1,5 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!1 &4115028211396559414 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 5496099548555633438} - - component: {fileID: 3952505140694061235} - - component: {fileID: 2709370056885251679} - - component: {fileID: 8153715504415854789} - m_Layer: 15 - m_Name: Text - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &5496099548555633438 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4115028211396559414} - 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_Children: [] - m_Father: {fileID: 3390467403729316765} - m_RootOrder: 1 - 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: 1.5} - m_SizeDelta: {x: 2, y: 0.5} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!23 &3952505140694061235 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4115028211396559414} - m_Enabled: 1 - m_CastShadows: 0 - m_ReceiveShadows: 0 - m_DynamicOccludee: 1 - 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: 1 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!114 &2709370056885251679 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4115028211396559414} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 9541d86e2fd84c1d9990edf0852d74ab, 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: 4294967293 - m_fontColor: {r: 0.993, 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 - m_hasFontAssetChanged: 0 - m_renderer: {fileID: 3952505140694061235} - m_maskType: 0 - _SortingLayer: 0 - _SortingLayerID: 0 - _SortingOrder: 0 ---- !u!114 &8153715504415854789 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4115028211396559414} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 8cf5a358dacd3b54ab093ee289dd9ba2, type: 3} - m_Name: - m_EditorClassIdentifier: - Cam: {fileID: 0} ---- !u!1 &4925002984753179688 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 8353389332891901056} - - component: {fileID: 3893924995767960437} - - component: {fileID: 3098454182384136765} - m_Layer: 15 - m_Name: CircleInner - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &8353389332891901056 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4925002984753179688} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.95, y: 0.5, z: 0.95} - m_Children: [] - m_Father: {fileID: 142224692930156368} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!33 &3893924995767960437 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4925002984753179688} - m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} ---- !u!23 &3098454182384136765 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4925002984753179688} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - 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: a8a7bf60a30970f469a9c9d3ae2de6ef, 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!1 &5866155945383417828 GameObject: m_ObjectHideFlags: 0 @@ -296,7 +31,7 @@ Transform: m_LocalScale: {x: 0.96, y: 0.51, z: 0.96} m_Children: [] m_Father: {fileID: 142224692930156368} - m_RootOrder: 1 + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!33 &3164742056485930267 MeshFilter: @@ -391,7 +126,6 @@ Transform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 0.01, z: 1} m_Children: - - {fileID: 8353389332891901056} - {fileID: 8554957501859850914} m_Father: {fileID: 3390467403729316765} m_RootOrder: 0 @@ -519,7 +253,6 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 142224692930156368} - - {fileID: 5496099548555633438} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/Scripts/InteractionEngine/FactHandling/FactSpawner.cs b/Assets/Scripts/InteractionEngine/FactHandling/FactSpawner.cs index 5e76885c5c9a9e61c686e3e8265b7e70ad3ae422..e833a539309351f25cb27c425c498dade5cfea30 100644 --- a/Assets/Scripts/InteractionEngine/FactHandling/FactSpawner.cs +++ b/Assets/Scripts/InteractionEngine/FactHandling/FactSpawner.cs @@ -199,11 +199,17 @@ public Fact SpawnAngle(Fact fact) public Fact SpawnRingAndCircle(Fact fact) { - _ = SpawnRing(fact); - return SpawnCircle(fact); + var ringAndCircleGO = new GameObject("RingAndCircle"); + _ = SpawnRing(fact, ringAndCircleGO.transform); + var circleFact = SpawnCircle(fact, ringAndCircleGO.transform); + + this.FactRepresentation = ringAndCircleGO; + circleFact.Representation = ringAndCircleGO; + + return circleFact; } - public Fact SpawnRing(Fact fact) + public Fact SpawnRing(Fact fact, Transform parent = null) { CircleFact circleFact = (CircleFact)fact; @@ -216,7 +222,7 @@ public Fact SpawnRing(Fact fact) //Change FactRepresentation to Ring this.FactRepresentation = Ring; - GameObject ring = Instantiate(FactRepresentation); + GameObject ring = Instantiate(FactRepresentation, parent); var tori = ring.GetComponentsInChildren<TorusGenerator>(); var tmpText = ring.GetComponentInChildren<TextMeshPro>(); @@ -246,7 +252,7 @@ public Fact SpawnRing(Fact fact) return circleFact; } - public Fact SpawnCircle(Fact fact) + public Fact SpawnCircle(Fact fact, Transform parent = null) { CircleFact circleFact = (CircleFact)fact; @@ -259,9 +265,8 @@ public Fact SpawnCircle(Fact fact) //Change FactRepresentation to Ring this.FactRepresentation = Circle; - GameObject circle = Instantiate(FactRepresentation); + GameObject circle = Instantiate(FactRepresentation, parent); - var tmpText = circle.GetComponentInChildren<TextMeshPro>(); var FactObj = circle.GetComponentInChildren<FactObject>(); //Move Circle to middlePoint @@ -273,12 +278,9 @@ public Fact SpawnCircle(Fact fact) else circle.transform.up = normal; - //Set radii + //Set radius circle.transform.localScale = new Vector3(radius * 2, circle.transform.localScale.y, radius * 2); - string text = $"○{middlePointFact.Label}"; - tmpText.text = text; - FactObj.URI = circleFact.Id; circleFact.Representation = circle; @@ -289,6 +291,7 @@ public Fact SpawnCircle(Fact fact) public void DeleteObject(Fact fact) { GameObject factRepresentation = fact.Representation; + print("Deleting: " + fact.Representation?.name); GameObject.Destroy(factRepresentation); }