diff --git a/Assets/Resources/Prefabs/ExhibitTitle.prefab b/Assets/Resources/Prefabs/ExhibitTitle.prefab index 346bf0e..5251f37 100644 --- a/Assets/Resources/Prefabs/ExhibitTitle.prefab +++ b/Assets/Resources/Prefabs/ExhibitTitle.prefab @@ -348,8 +348,8 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.88235295, g: 0.9607843, b: 0.99607843, a: 0.7490196} + m_Material: {fileID: 2100000, guid: 184173fb9a2399341882a894edcac032, type: 2} + m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 m_OnCullStateChanged: m_PersistentCalls: diff --git a/Assets/RothenburgAR/Scripts/Exhibition/ExhibitTitleBehaviour.cs b/Assets/RothenburgAR/Scripts/Exhibition/ExhibitTitleBehaviour.cs index f478e99..f1a6692 100644 --- a/Assets/RothenburgAR/Scripts/Exhibition/ExhibitTitleBehaviour.cs +++ b/Assets/RothenburgAR/Scripts/Exhibition/ExhibitTitleBehaviour.cs @@ -104,6 +104,7 @@ namespace RothenburgAR.Exhibition private IEnumerator CreateBorder() { yield return null; // wait for next frame so the borderContainer layouter has time to recalculate + var oldBorder = Background.GetComponentInChildren(); if (oldBorder != null) Destroy(oldBorder.gameObject); @@ -111,12 +112,12 @@ namespace RothenburgAR.Exhibition borderContainer.transform.SetParent(Background.transform, false); var outlineRenderer = borderContainer.AddComponent(); - outlineRenderer.useWorldSpace = true; + outlineRenderer.useWorldSpace = false; outlineRenderer.startWidth = 0.01f; outlineRenderer.endWidth = 0.01f; Vector3[] corners = new Vector3[4]; - Background.GetComponent().GetWorldCorners(corners); + Background.GetComponent().GetLocalCorners(corners); //produces weird seam at begin/end point, so we'll loop it ourselves by drawing back to topLeft and topRight manually outlineRenderer.loop = false; @@ -125,14 +126,21 @@ namespace RothenburgAR.Exhibition Vector3 topRight = corners[2]; Vector3 bottomLeft = corners[0]; Vector3 bottomRight = corners[3]; - outlineRenderer.positionCount = 6; + outlineRenderer.positionCount = 9; outlineRenderer.SetPosition(0, topLeft); outlineRenderer.SetPosition(1, topRight); outlineRenderer.SetPosition(2, bottomRight); outlineRenderer.SetPosition(3, bottomLeft); outlineRenderer.SetPosition(4, topLeft); - outlineRenderer.SetPosition(5, topRight); + outlineRenderer.SetPosition(5, bottomLeft); + outlineRenderer.SetPosition(6, bottomRight); + outlineRenderer.SetPosition(7, topRight); + outlineRenderer.SetPosition(8, topLeft); + outlineRenderer.numCornerVertices = 1; + outlineRenderer.numCapVertices = 1; + + outlineRenderer.alignment = LineAlignment.Local; outlineRenderer.material = UIColorSchemeManager.Instance.GetUIMaterial(UIMaterial.BaseOpaque); outlineRenderer.enabled = GuiText.GetComponent().enabled; }