Skip to content

Commit

Permalink
Hide trackers if no output
Browse files Browse the repository at this point in the history
  • Loading branch information
JLChnToZ committed Apr 8, 2024
1 parent 810db7f commit e4d2045
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Assets/Scenes/Bridge.unity
Original file line number Diff line number Diff line change
Expand Up @@ -10914,7 +10914,7 @@ Canvas:
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_VertexColorAlwaysGammaSpace: 0
m_VertexColorAlwaysGammaSpace: 1
m_AdditionalShaderChannelsFlag: 25
m_UpdateRectTransformForStandalone: 0
m_SortingLayerID: 0
Expand Down
2 changes: 2 additions & 0 deletions Assets/Scripts/VRCTrackerDisplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ public class VRCTrackerDisplay : MonoBehaviour {
if (colorId == 0) colorId = Shader.PropertyToID("_Color");
renderer = GetComponentInChildren<Renderer>(true);
propertyBlock = new MaterialPropertyBlock();
updatingTime = notUpdatedTimeout;
}

void Update() {
updatingTime += Time.deltaTime;
if (renderer != null) {
propertyBlock.SetColor(colorId, updatingTime > notUpdatedTimeout ? disconnectedColor : connectedColor);
renderer.SetPropertyBlock(propertyBlock, materialIndex);
renderer.enabled = updatingTime <= notUpdatedTimeout;
}
}

Expand Down

0 comments on commit e4d2045

Please sign in to comment.