How to use World Clusters
Get it here: https://bit.ly/2ZE9FVH
Watch the Introduction video:
Make sure to add the World Cluster Manager in your scene!
You can easily do that by:
Clicking the BLINK tab and World Clusters > Manager > Utilities > ADD MANAGER TO SCENE
Unity requires a rigidbody component to be on at least 1 of the game objects when 2 game object collides with each other. You can either add it on each world clusters colliders, but I highly suggest instead to add only one, on the player itself. Disable gravity and turn on kinematic if you do not want any physics from it.
World Clusters is NOT included with RPG Builder
This documentation section is separate from RPG Builder
Creating a new Cluster:
Simply add the Cluster component to any game object in your scene or prefab.
Cluster Groups:
A cluster is made of cluster groups.
Each cluster group have its own list of Entries.
Entries:
A cluster group is made of Entries.
Each Entry has its own type.
The currently available Entry types are:
GameObject:
Used to enable/disable game objects.
Light:
Used to enable/disable lights.
It is also giving you an optional transition feature, allowing to nicely blend the intensity of each light over time.
Renderer:
Used to enable/disable renderers.
There is also an option to disable the renderers but keeping the casted shadows.
Particle System:
Used to enable/disable particle systems.
Material Change:
Used to swap the material from a renderer.
Layer:
Used to swap the layer of a game object.
Tag:
Used to swap the tag of a game object.
Collision conditions:
These are used to allow or not a collider to trigger a collider when colliding with it.
They are Scriptable objects, allowing you to make them once and re-use them.
Game Object Name:
The game object colliding must have this name.
Layer:
The game object colliding must have this layer.
Tag:
The game object colliding must have this tag.
Rule:
If a condition is optional, at least one of all optional options must be true.
If a condition is required, it has to be true.
Cluster Collider:
Add a Cluster Collider component on your game object that has the collider.
Then simply drag and drop the cluster to trigger and select the Cluster Group that should be executed.
Triggering Clusters without a collisions
Cluster Instant Trigger:
Drag and drop the Cluster to trigger in the Cluster field
Chose which event type should be triggered
Pick which cluster group should be executed
If Toggle is on, it will trigger both enter and exit, each at their turn.
Mouse Actions:
You can chose for this cluster to be triggered on Mouse Enter, Mouse Exit, Left Click.
Unity Event:
To trigger a cluster with a Unity Event you first need to setup a Cluster Instant Trigger, that way you can fill in all the information needed. No collider needed, it can simply be on an empty game object somewhere.
Then simply drag and drop the game object with the Cluster Instant Trigger component inside your Unity Event field and select the TriggerThisCluster() method.
By code:
You can trigger any cluster in your own code by using the following line of code:
ClusterLogic.TriggerClusterInstantly(cluster, clusterGroupIndex, actionEventType);
"cluster" = The Cluster reference of the Cluster component in the scene
"clusterGroupIndex" = The cluster group index to execute on this cluster
"actionEventType" = Which action to trigger on this cluster. Enter OR Exit