Updated visuals and polish

This commit is contained in:
2020-01-27 16:31:38 +01:00
parent 0d80cee4aa
commit 12dbfae935
39 changed files with 1486 additions and 28 deletions

View File

@@ -0,0 +1,46 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GoalLight : MonoBehaviour
{
public float lerpSpeed = 2.0f;
public float intensity;
private Light light;
private bool resetLight = true;
private float lerpT = 0;
// Start is called before the first frame update
void Start()
{
this.light = GetComponent<Light>();
}
// Update is called once per frame
void Update()
{
if (this.resetLight)
{
this.lerpT -= Time.deltaTime * lerpSpeed;
light.intensity = Mathf.Lerp(0.0f, this.intensity, this.lerpT);
} else
{
this.lerpT += Time.deltaTime * lerpSpeed * 2f;
light.intensity = Mathf.Lerp(0.0f, this.intensity, this.lerpT);
}
if (this.lerpT > 1)
{
this.resetLight = true;
}
}
public void LightUp()
{
this.lerpT = 0;
this.resetLight = false;
this.light.enabled = true;
}
}