tnt graphics, bug fixes, folder organization
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
public class Streetlight : MonoBehaviour
|
||||
{
|
||||
// Hours that the light starts and ends
|
||||
public int[] activeHours = { 18, 19, 20, 21, 22, 23, 0, 1, 2, 3, 4, 5, 6 };
|
||||
|
||||
Light objectLight;
|
||||
private float lightIntensity;
|
||||
|
||||
void Start()
|
||||
{
|
||||
objectLight = GetComponent<Light>();
|
||||
lightIntensity = objectLight.intensity;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (activeHours.Contains(GameManager.Instance.TimeManager.GetCurrentHour()))
|
||||
{
|
||||
objectLight.intensity = lightIntensity;
|
||||
}
|
||||
else
|
||||
{
|
||||
objectLight.intensity = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user