GGJ2022/Assets/Scripts/PostProcessingController.cs

44 lines
1019 B
C#
Raw Normal View History

2022-01-28 20:29:53 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PostProcessingController : MonoBehaviour
{
[ColorUsageAttribute(true, true)] public Color color;
public Renderer renderer;
public bool emissionUp = false;
private int emmisionStep = 0;
public int emmisionStepChange = 30;
// Start is called before the first frame update
void Start()
{
color = renderer.material.GetColor("_EmissionColor");
}
// Update is called once per frame
void FixedUpdate()
{
if (emmisionStep < emmisionStepChange)
{
if (emissionUp)
{
color += color * 0.01f;
}
else
{
color -= color * 0.01f;
}
}
else
{
emissionUp = !emissionUp;
emmisionStep = 0;
}
emmisionStep++;
renderer.material.SetColor("_EmissionColor", color);
2022-01-28 21:27:24 +00:00
//Debug.Log(color);
2022-01-28 20:29:53 +00:00
}
}