From 90b36bbd56a9cc8f18970a200bcb76d4d83fb6c3 Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 21 Jul 2025 23:28:35 +0200 Subject: [PATCH] Revert "Color Interpolation" This reverts commit 67eb99b749d449778427f09e87d48afa52d41c51. --- .../Assets/Scripts/Models/ModelBehaviour.cs | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/vr-configurator/Assets/Scripts/Models/ModelBehaviour.cs b/vr-configurator/Assets/Scripts/Models/ModelBehaviour.cs index fb90a19..6951d35 100644 --- a/vr-configurator/Assets/Scripts/Models/ModelBehaviour.cs +++ b/vr-configurator/Assets/Scripts/Models/ModelBehaviour.cs @@ -39,9 +39,6 @@ public class ModelBehaviour : MonoBehaviour, IResettable public PortSelector PortSelector; public int Index = -1; - const int FinalColorTick = 60; //shouldnt take too long - Color _oldColor = Color.black; - int colorTick = FinalColorTick; Color _color = Color.black; Color Color { @@ -49,8 +46,10 @@ public class ModelBehaviour : MonoBehaviour, IResettable set { var clonedMaterial = new Material(meshRenderer.material); //clone da sonst alle anderen mit dem mat auch colorchanged werden - meshRenderer.material = clonedMaterial; // Actual color setting happens in Update + clonedMaterial.color = value; + meshRenderer.material = clonedMaterial; Debug.Log($"{name}: Set color from {_color} to {value}"); + _color = value; if (Model.Passthrough) { Debug.Log($"{name}: Passthrough {_children.Count}"); @@ -60,9 +59,6 @@ public class ModelBehaviour : MonoBehaviour, IResettable go.GetComponent().Color = value; } } - _oldColor = _color; - _color = value; - colorTick = 0; } } @@ -77,15 +73,6 @@ public class ModelBehaviour : MonoBehaviour, IResettable ModelManager = FindFirstObjectByType(); } - void Update() - { - if (colorTick < FinalColorTick) - { - meshRenderer.material.color = Color.Lerp(_oldColor, _color, colorTick * 1.0f / FinalColorTick); - colorTick++; - } - } - void LateUpdate() { if (!lateInited)