Steps to Add a New Effect Type
In this section, you will learn how to modify the existing scripts to tailor RSM to your specific needs.
Create a Coroutine Method
Inside RealtimeShaderManipulator.cs, create a new coroutine. For example:
private IEnumerator Flashing(ShaderControlConfig config)
{
//Your logic here
yield return null;
}
Update HandleEffect() Method
Still in RealtimeShaderManipulator.cs, modify the HandleEffect() method to handle your new type:
private IEnumerator HandleEffect(ShaderControlConfig config,
ShaderChangeType changeType)
{
yield return changeType switch
{
//Other ShaderChangeTypes (Incremental, Decremental,... etc...)
ShaderChangeType.Flashing => Flashing(config), //Add your ShaderChangeType like this.
_ => null
};
//Other logic
yield break;
}
Add to the Enum
In ShaderChangeType.cs, add your new type:
public enum ShaderChangeType
{
//Other enums (Incremental, Decremental, etc..)
Flashing //Add this
}
(Optional) Update the Editor Script
If your effect introduces new editable parameters, you’ll need to expose them in the custom editor UI.
Modify ShaderControlConfig.cs for the new variables and modify RealtimeShaderManipulatorEditor.cs to draw the new fields as needed.
Last updated