improve Highlight

This commit is contained in:
2023-12-13 20:51:09 +02:00
parent 11c4d217c3
commit 72191123c2
11 changed files with 24 additions and 451 deletions
+3 -1
View File
@@ -4,11 +4,12 @@ using UnityEngine;
public class Hightlight : MonoBehaviour
{
[SerializeField]
private Color color = new Color(147, 142, 142, 1);
private Color color = Color.white;
private Renderer[] renderers;
//helper list to cache all the materials ofd this object
private List<Material> materials;
private const float INTENSITY = .15f;
//Gets all the materials from each renderer
private void Awake()
@@ -21,6 +22,7 @@ public class Hightlight : MonoBehaviour
//that is why we need to all materials with "s"
materials.AddRange(new List<Material>(renderer.materials));
}
color = color * INTENSITY;
}
public void ToggleHighlight(bool val)