Scripting

v1.0

The system allows for overriding the values, enabling custom UI experiences for your project. There are also some additional scripts included in the package which you may find useful.

Many of the scripts have virtual methods. This means you can create your own child classes which override these methods with custom logic, or even add additional methods for your game.

Blending Mode

Runtime Color Settings and Runtime Color Listeners have the option to blend colors, and can select different blend modes. The Runtime Color Utilities class contains the BlendMode enum with the following options:

  • Replace

  • Multiply

  • Override

  • Screen

  • Soft Light

  • Hard Light

  • Difference

  • Addition

Runtime Color

You can get a Runtime Color Settings object by name.

var settings = RuntimeColor.instance.Settings("Settings Object Name");

Runtime Color Settings

Any changes made to the Runtime Color Settings will be passed to all of the Runtime Color Listeners which are watching the Settings. This is a convenient way to effect all of those objects at once.

Override the Min or Max Color

// Enable the override
runtimeColorSettings.OverrideMinColor(Color.white);
runtimeColorSettings.OverrideMaxColor(myColorValue);

// Disable the override
runtimeColorSettings.ResetMinColor();
runtimeColorSettings.ResetMaxColor();

Blend Output to New Color

This will modify the output value to a specific color, blending from 0% to 100%, with the float blendAmount set from 0f to 1f. There are also blending options you can choose from.

Blending the output to a new color on the Runtime Color Settings object happens before the option to do the same thing on objects which are listening to the Settings object. This means that any overrides on this will take in this output as input, and then override it for just that one object.

runtimeColorSettings.SetBlendColor(colorValue);
runtimeColorSettings.SetBlendMode(RuntimeColorUtilities.BlendMode.Replace);
runtimeColorSettings.SetBlendAmount(0.75f);

Runtime Color Listener

Blend Output to New Color

This will modify the output value to a specific color, blending from 0% to 100%, with the float blendAmount set from 0f to 1f. There are also blending options you can choose from.

runtimeColorListener.SetBlendColor(colorValue);
runtimeColorListener.SetBlendMode(RuntimeColorUtilities.BlendMode.Replace);
runtimeColorListener.SetBlendAmount(0.75f);

Last updated