Scene Setup
6_ScriptableEnums
Last updated
6_ScriptableEnums
Last updated
In this scene, you will find four GameObjects named "Element." Each Element has an Element.cs component attached to it, which references a different Scriptable Enum (SE). If you select the first one, you will see that it references the Fire SE as its ElementType.
If you click on this SE, you will see that it contains additional data: a color field and a list (Defeats) of ScriptableObjects. The latter list contains other Scriptable Enums that this element destroys.
If you play the game, use WASD to move the fire element and try to collide with the other elements. As indicated in the Defeats list, if you collide with Earth, you will destroy that element. However, if you collide with Water, the fire element will be destroyed. The current data is set up as follows: