Roland09 / Fader

General purpose fader to fade Materials, Enviro, etc in Unity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fader

Description

Fader allows you to lerp between values and colors for a given duration and toggle lerp direction.

Specific implementations can e. g. fade Materials, Enviro Time, VFX Spawn Rate, etc in and out in Unity.

Example Implementations

  • Material Property
    • Fade Float and Color Properties of Materials
  • Material Object
    • Fade two material using Unity's internal Material.Lerp function
  • VFX
    • Fade VFX property values
  • Enviro
    • Fade Enviro's time in and out. This requires the scripting define symbol ENVIRO to be defined
  • Aura 2
    • Fade the Aura 2 Camera and Fade the Aura 2 Volume

Example Setup

setup

In my case I was toying around with the new Malbers Realistic Wolf. The eyes use the Standard material, property _EmissionColor as color. The fur is a special shader with a property _EmissionPower as float.

Looks like this then:

magic wolf

This video clip shows how it looks with both the Material Property and Enviro Fader applied:

If you need a custom fader, I suggest to check out VFXFader.cs or EnviroTimeFader.cs. The implementation should be straightforward.

About

General purpose fader to fade Materials, Enviro, etc in Unity

License:MIT License


Languages

Language:C# 100.0%