I have this script i whant that when the SkyType enum is in cloudy the cloudMaterial float “CutOff” increase exponentially to 1 and when the enum its in sunny the CutOff decrease to 0
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RainSystem : MonoBehaviour
{
public enum SkyType { Sunny,Cloudy};
public SkyType skyType;
public Material cloudMaterial;
private void Start()
{
}
void Update()
{
switch (skyType)
{
case SkyType.Cloudy:
Cloudy();
break;
case SkyType.Sunny:
Sunny();
break;
}
}
void Cloudy()
{
cloudMaterial.SetFloat("_CutOff", 1);
}
void Sunny()
{
cloudMaterial.SetFloat("_CutOff", 0);
}
}