Replaced LineRenderer border around ExhibitTitles with a masked Rect

This commit is contained in:
2018-11-02 15:31:58 +01:00
parent b613c36cdc
commit 162547eb14
7 changed files with 414 additions and 18 deletions

View File

@@ -0,0 +1,83 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: UITitleBorderMask
m_Shader: {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: UNITY_UI_ALPHACLIP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _ColorMask: 0
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Stencil: 1
- _StencilComp: 8
- _StencilOp: 2
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UVSec: 0
- _UseUIAlphaClip: 1
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 0.003921569}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 128761c3e26715b46981f67595fa1df6
timeCreated: 1541168102
licenseType: Free
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,83 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: UITitleBorderMasked
m_Shader: {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _ColorMask: 15
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Stencil: 2
- _StencilComp: 3
- _StencilOp: 0
- _StencilReadMask: 1
- _StencilWriteMask: 0
- _UVSec: 0
- _UseUIAlphaClip: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.011764706, g: 0.6627451, b: 0.95686275, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 8cca5cb1a6ffb274c8f91bb2e09b7b82
timeCreated: 1541167711
licenseType: Free
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -11,9 +11,26 @@ Prefab:
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 1561232343491480}
m_IsPrefabParent: 1
--- !u!1 &1014424568659828
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224553231663331444}
- component: {fileID: 222544048370297100}
- component: {fileID: 114476422379905922}
m_Layer: 0
m_Name: Border
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1128853001878032
GameObject:
m_ObjectHideFlags: 0
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
@@ -21,9 +38,9 @@ GameObject:
- component: {fileID: 224366238922922626}
- component: {fileID: 222423545703559624}
- component: {fileID: 114807976848859904}
- component: {fileID: 114079883078300150}
- component: {fileID: 114360769153676356}
m_Layer: 0
m_Name: Background
m_Name: Mask
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@@ -50,6 +67,22 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1506955487736844
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224904405998392930}
- component: {fileID: 114084726944721854}
m_Layer: 0
m_Name: Border
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1508351644051650
GameObject:
m_ObjectHideFlags: 0
@@ -87,6 +120,24 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &1798097966462362
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 5
m_Component:
- component: {fileID: 224577103722075562}
- component: {fileID: 222375422432509192}
- component: {fileID: 114046157392020520}
- component: {fileID: 114079883078300150}
m_Layer: 0
m_Name: Background
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!23 &23656124227573408
MeshRenderer:
m_ObjectHideFlags: 1
@@ -128,12 +179,58 @@ MeshFilter:
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1153460862401542}
m_Mesh: {fileID: 0}
--- !u!114 &114046157392020520
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1798097966462362}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
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:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!114 &114079883078300150
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1128853001878032}
m_GameObject: {fileID: 1798097966462362}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreLayout: 1
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: -1
m_PreferredHeight: -1
m_FlexibleWidth: -1
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!114 &114084726944721854
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1506955487736844}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3}
@@ -166,6 +263,18 @@ MonoBehaviour:
m_FlexibleWidth: -1
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!114 &114360769153676356
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1128853001878032}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: -1200242548, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ShowMaskGraphic: 1
--- !u!114 &114416352051726708
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -177,7 +286,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: bd0b15f7f87279d44b52fffd4484095b, type: 3}
m_Name:
m_EditorClassIdentifier:
Background: {fileID: 1128853001878032}
Background: {fileID: 1798097966462362}
PoiSpacer: {fileID: 1508351644051650}
Exhibit: {fileID: 0}
--- !u!114 &114464711075482232
@@ -207,6 +316,33 @@ MonoBehaviour:
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!114 &114476422379905922
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1014424568659828}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 2100000, guid: 8cca5cb1a6ffb274c8f91bb2e09b7b82, type: 2}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
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
--- !u!114 &114580846098669954
MonoBehaviour:
m_ObjectHideFlags: 1
@@ -361,7 +497,7 @@ MonoBehaviour:
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 2100000, guid: 184173fb9a2399341882a894edcac032, type: 2}
m_Material: {fileID: 2100000, guid: 128761c3e26715b46981f67595fa1df6, type: 2}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
@@ -370,7 +506,7 @@ MonoBehaviour:
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 0}
m_Type: 1
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
@@ -412,12 +548,24 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_HorizontalFit: 2
m_VerticalFit: 2
--- !u!222 &222375422432509192
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1798097966462362}
--- !u!222 &222423545703559624
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1128853001878032}
--- !u!222 &222544048370297100
CanvasRenderer:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1014424568659828}
--- !u!222 &222811054124192620
CanvasRenderer:
m_ObjectHideFlags: 1
@@ -462,7 +610,8 @@ RectTransform:
m_Children:
- {fileID: 224381549858292536}
- {fileID: 224646014036279432}
- {fileID: 224366238922922626}
- {fileID: 224577103722075562}
- {fileID: 224904405998392930}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
@@ -477,12 +626,12 @@ RectTransform:
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1128853001878032}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
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: 224308775056715718}
m_RootOrder: 2
m_Father: {fileID: 224904405998392930}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
@@ -507,6 +656,42 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224553231663331444
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1014424568659828}
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: 224904405998392930}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0.02, y: 0.02}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224577103722075562
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1798097966462362}
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: 224308775056715718}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224646014036279432
RectTransform:
m_ObjectHideFlags: 1
@@ -525,3 +710,23 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!224 &224904405998392930
RectTransform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1506955487736844}
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:
- {fileID: 224366238922922626}
- {fileID: 224553231663331444}
m_Father: {fileID: 224308775056715718}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}

View File

@@ -57,7 +57,7 @@ namespace RothenburgAR.Exhibition
{
GuiText.GetComponent<LayoutElement>().enabled = false;
GuiText.GetComponent<LayoutElement>().enabled = true;
StartCoroutine(CreateBorder());
//StartCoroutine(CreateBorder());
}
public void SetDescription(TextElement newDescription)
@@ -72,20 +72,21 @@ namespace RothenburgAR.Exhibition
_descriptionPoiBehaviour.IsTitlePoi = true;
var spriteRendererArray = _descriptionPoiBehaviour.gameObject.GetComponentsInChildren<SpriteRenderer>();
foreach (var spriteRender in spriteRendererArray)
{
spriteRender.material = UIColorSchemeManager.Instance.GetUIMaterial(UIMaterial.BaseOpaque);
spriteRender.sortingOrder = 1;
}
// Set data reference
_descriptionPoiBehaviour.Exhibit = Exhibit;
_descriptionPoiBehaviour.ReferencedID = "TITLE:" + Exhibit.ID;
// Set position of the POI
_descriptionPoiBehaviour.transform.localScale = new Vector3(0.85f, 0.85f, 0.85f);
_descriptionPoiBehaviour.transform.SetParent(PoiSpacer.transform);
_descriptionPoiBehaviour.transform.localPosition = Vector3.zero;
// Set position of the POI
_descriptionPoiBehaviour.Exhibit = Exhibit;
_descriptionPoiBehaviour.ReferencedID = "TITLE:" + Exhibit.ID;
// Set POI Rotation
var transformLocalRotation = _descriptionPoiBehaviour.transform.localRotation;
transformLocalRotation.x = 0f;

View File

@@ -18,6 +18,7 @@ namespace RothenburgAR.UI
ProjectionEffect,
ExhibitOutline,
ReticuleBorder,
TitleBorder,
}
@@ -59,6 +60,7 @@ namespace RothenburgAR.UI
_uiMaterials[UIMaterial.ProjectionEffect].color = scheme.LightColorTransparent;
_uiMaterials[UIMaterial.ExhibitOutline].color = scheme.BaseColorOpaque;
_uiMaterials[UIMaterial.ReticuleBorder].color = scheme.BaseColorTransparent;
_uiMaterials[UIMaterial.TitleBorder].color = scheme.BaseColorOpaque;
}
public Material GetUIMaterial(UIMaterial uiMaterial)
@@ -85,7 +87,9 @@ namespace RothenburgAR.UI
{UIMaterial.DarkTransparent, Resources.Load<Material>("Materials/UIDarkTransparent")},
{UIMaterial.ProjectionEffect, Resources.Load<Material>("Materials/UIMaterialProjectionEffect")},
{UIMaterial.ExhibitOutline, Resources.Load<Material>("Materials/UIExhibitOutline")},
{UIMaterial.ReticuleBorder, Resources.Load<Material>("Materials/UIReticuleMasked")}
{UIMaterial.ReticuleBorder, Resources.Load<Material>("Materials/UIReticuleMasked")},
{UIMaterial.TitleBorder, Resources.Load<Material>("Materials/UITitleBorderMasked")}
};
}