GenesisEffects
GenesisEffects exposes the gameplay-facing FX of a Genesis material — dissolve, hologram, hit flash, intersection glow, and fade-by-distance. It is reached through GenesisMaterial.Effects and includes both immediate setters and time-driven Play* helpers.
using Genesis.Runtime;
var gm = new GenesisMaterial(GetComponent<Renderer>());
gm.Effects.PlayHitFlash(Color.red, 0.15f);
gm.Effects.SetDissolveAmount(0.5f);
gm.Apply();The Play* methods return a Coroutine started on a shared runner and call Apply() internally each frame — you do not need to manage the MaterialPropertyBlock flush yourself for those. Plain setters still require gm.Apply().
Properties
Methods
Examples
Dissolve a defeated enemy
using Genesis.Runtime;
using UnityEngine;
public class Death : MonoBehaviour
{
[SerializeField] Renderer target;
GenesisMaterial gm;
void Awake() => gm = new GenesisMaterial(target);
void OnDestroy() => gm.Dispose();
public void Die()
{
gm.Effects.PlayHitFlash(Color.white, 0.1f);
gm.Effects.PlayDissolve(1.2f);
}
}Reveal a hologram on interact
public void ShowHologram(GenesisMaterial gm)
{
gm.Effects.EnableHologram(new Color(0.3f, 0.9f, 1f) * 2f);
gm.Effects.PlayDissolve(0.5f, reverse: true);
}PlayHitFlash and PlayDissolve allocate one coroutine per call. For projectiles or bullet-hell volumes that flash hundreds of renderers per frame, pool the effect or drive HitAmount directly from a single update loop instead of starting a coroutine each hit.
See also
Last updated on