9/1/2023 0 Comments Scriptable objects build![]() Next, I had to visualise this information into the Event Manager window. This means I now have all the Events being used in the scene, and each object that uses them. Next, I can store the GameEvent and GameObject information from each list value into a Dictionary (one which takes a GameEvent and a GameObject and making sure there are no doubles of the GameEvent). This component has a soGameEvent variable slot (which is public), so I can use a FindAllObjectsOfType and store all those objects into a list. ![]() The first step was getting all the GameObjects in the scene that have the Event Listener component (part of the Scriptable Object Event System pattern). ![]() Thus, I decided to try and create a window that would alleviate this issue. One issue with Event Systems is it can be hard to visualise how everything is connected – especially when it’s all in code. So, all the Event Logic was already implemented, however I felt that there should be an easy way to view what events are being used within the current scene. I will explain more specifically what I did below. This included adding an Event Manager Window and making the Variables have specific functionality based on what type it was. Upon implementing the Variable and Event System, I found that there were several features I could add to both, that would add more functionality for designers to use. You can also use Scriptable Objects to build an Event System, one that requires minimal coding to use, and is much more visual/designer friendly to use. This makes testing/debugging a much easier process and doesn’t require rebuilding the entire scene to test one small part of it. Using them as variables, that multiple objects can access – like player health, thus reducing the reliance/need for manager objects. This project was inspired by the Unite 2017 talk by Ryan Hipple, that talks about how Scriptable Objects can be used to build more extensible systems and data patterns. It also lets you trigger any of the events from the window - making debugging & testing the events nice and easy. By using Scriptable Object Events you can quickly create, subscribe objects and test events, without writing a line of code! You can also easily manage your events through the Event Manager window which helps visualize how your events are being used within the current scene. Make your code more modular with this Scriptable Event Management System.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |