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)
+2 -2
View File
@@ -11,8 +11,8 @@ public class TimeSystem
private TimeSpan _startTime = new TimeSpan(1, 08, 00, 00);
private float _sunriseHour;
private float _sunsetHour;
private float _sunriseHour=8;
private float _sunsetHour=20;
private TimeSpan _sunriseTime;
private TimeSpan _sunsetTime;
+2 -3
View File
@@ -20,10 +20,10 @@ public class TopBarUI : MonoBehaviour
[SerializeField]
public Slider _food;
// Start is called before the first frame update
private void Start()
private void Awake()
{
GameManager.Instance.Time.OnMinuteChanged -= UpdateTime;
GameManager.Instance.Time.OnMinuteChanged += UpdateTime;
}
@@ -37,7 +37,6 @@ public class TopBarUI : MonoBehaviour
{
_moneyText.text = $"${(Player.Instance.Stats[StatsId.Money] as INumericStat).Value}";
_locationText.text= $"{(Player.Instance.Stats[StatsId.LocationName] as IStringStat).Value}";
}
private void UpdateTime()