Author
Topic: "Jelly Sprites" Events Bridge? (Read 911 times)

I am working with the "Jelly Sprites" plugin from the asset store and I was trying to get their custom events working so they could communicate with my FSMs. I made a "bridge" (I believe that is the correct term) so that could happen. I wanted to share it with anyone who has purchased the Jelly Sprites asset. They use custom trigger and collision events and the regular trigger and collision Playmaker event receivers wont pick them up. Hopefully I did it in an acceptable way(optimization wise). I made it in Unity 5 so I don't know if it will work in previous versions of Unity since the way you type stuff changed.

How to use:

1. Attach this script(JellyScriptFsmEventBridge) to your Jelly Sprite Gameobject.2. Create any collision/trigger event from their documentation (i.e. "OnJellyCollisionEnter") in your FSM and it will be called upon colliding.

*Optional Variables*

There are two variables which are both optional.

Go Obj: the Game Object with the FSMs you want to send the jelly events to. If null it uses the owner game object.

Collided Go Variable: The variable name in your FSMs that you want to store the object the jelly sprite collided with. The name in this variable slot needs to match the FSM's GameObject variable name for it to set it. If null it will do nothing and just receive the events and not set anything.

Hope someone finds this useful. I wasn't able to test every event but I did a lot of copy and paste and the ones I did test worked great.