The next version of CyanTrigger is almost here! Time to read the book that is this change list. Version 0.4 adds multiple new features and fixes many bugs. CyanTrigger V0.4 will be available for $5 and above supporters starting July 1st, and available to everyone for free in August.
CyanTrigger now has an icon! Every CyanTrigger component will have this icon and it will show every CyanTrigger in the scene. Clicking on the icon will select that object.
You can hide the icon in the Gizmos section
The CyanTrigger interface now has color to help distinguish items.
All color options can be changed in the settings. Light and Dark themes can be configured separately. Colors can be exported and imported so people can share their themes. If you don’t like the color, you can also disable it to go back to the previous look.
CyanTrigger now has an option for replaying events for late joiners. This is my replacement for a simple method of syncing similar SDK2’s Buffered Triggers. Note that while similar, these are NOT the same and will act differently. A video tutorial on this will be released along with V0.4. You can also read the documentation now to get the general idea. There are 3 Replay Types: Replay Once, Replay Parity, and Replay All. Along with these options, there is a new Action called Clear Replay which allows you to clear replay data for an event.
Some actions now have dropdown selectors allowing you to pick specific items instead of manually typing it out and potentially making a mistake.
You can now define parameters on Custom Events, making it easier to pass data around between CyanTrigger events, including different CyanTriggers. When using UdonBehaviour.SendCustomEvent, events with parameters will show and provide editors for each parameter. You can only use parameters with local events that do not have a delay. Note that this only supports CyanTrigger and not UdonSharp methods.
You can now view CyanTrigger in playmode! Along with viewing all events, actions, and inputs, the variable editors will edit the current values for the UdonBehaviour. You can also execute specific events by clicking the buttons above the event.
The CyanTrigger interface now has many buttons to let you bring up the documentation for a part of the interface. All buttons for the interface will take you to the CyanTrigger Wiki. If you hover over Actions, Events, and Variables the documentation button will also appear here so you can read the Unity or C# documentation on that Action, Event, or Variable Type.
You can now create CyanTrigger Program Assets similar to UdonGraph and UdonSharp. These assets contain all the logic for a CyanTrigger, can be edited at any time outside the scene, and can be reused on multiple objects or even the same object. Since it is a file in the Assets folder, it can be exported and shared between projects. CyanTrigger components and Program Assets can easily be converted between each other, so you aren’t locked into just one. You can read more information on the documentation.
Along with the new Program Asset, there is a new Component called “CyanTriggerAsset” which is the intended way to use a Program Asset in a scene or prefab. This new component lets you edit the program asset in the scene inspector, saves variables, supports multi object editing, and properly saves prefab and nested prefab changes!
Custom Actions are CyanTrigger’s implementation of “Sub Programs”. These have existed since the first version of CyanTrigger, but had many limitations… But not any more! All known bugs have been fixed and multiple new features have been added, expanding the power of Custom Actions. With the Custom Actions framework, you can define your own Actions, Events, and even custom variable types. Custom Actions can be as simple as a shortcut to writing a few actions you use often, to as complex as full custom programs that are automatically added to a CyanTrigger that references it. Be sure to check out the documentation to learn more about them and how to create them.
Here are some of the features with Custom Actions:
When using Custom Actions in a CyanTrigger, there are more indicators letting you know something is a Custom Action. Custom Actions will now have an asterisk* after the name, display with a different color in the Action List, and when expanded, will show the program and definition allowing you to click into it to see what it is doing. When you hover over a Custom Action, instead of a documentation button, you will see an icon you can click to also go to the program that defines it.
CyanTrigger Settings have been moved into the Project Settings window. Along with the new location, you will see it separated out. At the top level, you can change settings, and under that you can select and change individual Variable, Action, and Event favorite lists. There is now a button at the bottom of every CyanTrigger that can open the settings window. Here are the settings options:
Some Events in Udon seem to act global even when the CyanTrigger broadcast is set to local. For these actions, a warning will appear to let you know that something may be strange, and suggest using one of the available Custom Actions to help limit it. These warnings will show in the inspector and log during compile time, to help warn about CyanTrigger created from before v0.4. If an Event is intended, the warnings can also be ignored for that CyanTrigger.
Figuring out Sync in Udon is difficult and can be confusing for new users. With this new setting, CyanTrigger will try to auto figure out the “Sync Mode” for you. It can also be disabled so you can set a specific Sync Mode. With this, Sync Mode None is now supported with CyanTrigger.
In the previous version, when an action modified a value, the variable had to be defined in another action before an action used it. With V0.4, you can define a new variable on that action directly. This almost removes the need for a dedicated action to create local variables and will cut out a large number of actions for more complicated logic.
The Variables section now supports groups and comments, helping you organize your variables. If working with CyanTrigger Program Assets, variables can also be hidden to not distract from the main inputs.
More examples have been added and have been separated out in groups
You can find all under in your Assets folder under CyanTrigger/Examples/Scenes. Be sure to check out the prefabs too.
If you want to read about all the Actions and Events that are specific to CyanTrigger and not in general Udon, check out the documentation page.
SDK2’s OnTimer is back. You can easily create cancel-able delays again.
GameObject.SetComponentActive already existed, but the toggle version was missing. Not anymore. Now you can toggle components more easily. This action also supports dropdowns to select the component without typing it manually.
The For action already existed as a way to easily loop between two values. With ForEach, you can now easily go through each element in an array, saving a few actions to find the length and get the object from the array.
Multiple Custom Actions have been added to help in creating logic. Since they use Custom Actions, it means you can look at how they were created, if you wanted to learn or make something similar.
One major lacking item in CyanTrigger compared to SDK2 was that randomizing events was very tedious. It took over 14 actions just to pick between 3 events. That’s not usable at all. With the UdonBehaviour.RandomEvent Custom Action, it’s all in one to easily randomize between any number of events!
Another event from SDK2 that was missing in CyanTrigger was OnKeyDown and OnKeyUp. While it was only about 4 actions, these have now been simplified into one Custom Action selectable in the Event List. You can now easily check for keys on your keyboard again.
DataCache is a new collection of Custom Actions to help reduce the need for finding specific objects and getting/setting values on them. These actions allow you to set a key value pair, and then get the value on ANY other CyanTrigger using that key. There are multiple supported types for DataCache, and since string is supported, you can also expand it to make your own. DataCache is extremely helpful when working with Udon Singletons and prefabs. If you have a prefab that you don’t want to manually link up a GameObject or UdonBehaviour, you can use DataCache to set it once, and have everything just get it. The prefab now becomes drag and drop! An example of this is used in the new FadeController prefab with the associated Custom Actions. DataCache uses VRCPlayerApi tags behind the scenes.
Udon does not currently support the List type, which are auto growing arrays. With Custom Actions and the new Custom Action Instances, you can create your own lists or use ArrayList instead to auto handle your array size. Pairing UdonArrayLists with UdonDataCache is an easy way to have one object keep track of many others for sending events.
There are too many actions to fully describe, so here is a list.
The action CyanTrigger.SendCustomEvent has been removed, and will automatically be replaced with UdonBehaviour.SendCustomEvent. From now on, use this new SendCustomEvent instead, as it works for all Udon types and is not limited to just CyanTrigger.
Since this is a major update, in order to upgrade from a previous version of CyanTrigger, you need to delete the old CyanTrigger files first before importing. This includes the CyanTrigger examples folder. Any scripts that referenced CyanTrigger will also break and need to be manually updated. This means that the SDK2 Migrator does not support this version. An update will be published later to resolve this.