OndrejNepozitek / Edgar-Unity

Unity Procedural Level Generator
https://ondrejnepozitek.github.io/Edgar-Unity/docs/introduction
MIT License
817 stars 70 forks source link

Make MarkerType a scriptable object #6

Closed OndrejNepozitek closed 5 years ago

OndrejNepozitek commented 5 years ago

MarkerType is currently an enum. This makes it impossible to add a new marker type without changing the original source code.

Possible solution is to use a scriptable object instead. It would let users at their own marker types and write scripts that can work with them.

Example usecase:

  1. Create custom marker type for torches
  2. Create pipeline task that is able to add torches to the layout
  3. Use a basic templating task to assign torch tile to the torch marker type

It would be also nice to have a typesafety similar to enums. One possible approach is to make a class that will hold references to individual marker types, e.g. MarkerType.Wall, MarkerType.Floor etc..