API Usage
The Chroma SDK supports playing premade Chroma animations which are placed in the StreamingAssets
folder or subfolders within. Chroma animations can be created in the web authoring tools, or dynamically created and modified using the API. Call PlayAnimation() to play Chroma animations with or without looping. Animations have a device category, and playing an animation will stop an existing animation from playing before playing the new animation for the given device category. The animation name is file path of the Chroma animation relative to the StreamingAssets
folder.
bool loop = false;
string[] devices =
{
"ChromaLink",
"Headset",
"Keyboard",
"Keypad",
"Mouse",
"Mousepad"
};
foreach (string device in devices)
{
// The Chroma animation files are located in the subfolder at:
// Assets/StreamingAssets/Animations/
string animationName = string.Format("Animations/Spiral_{0}.chroma", device);
ChromaAnimationAPI.PlayAnimationName(animationName, loop);
}
Still stuck? Come to our Discord and we will help you out!