Custom Enum
To use an enum as a lobby custom value, you either need to create a new script file inside the Assets/Easy Game Lobby/Runtime
folder or:
- Create a new folder
- Add a new Assembly Definition Reference.
- Right-click on the new folder and select
Create > Assembly Definition Reference
. - On the
Assembly Definition Reference
inspector, add thecom.oblige.easygamelobby
assembly definition.
- Right-click on the new folder and select
- Create a new script file inside the folder.
After creating the file you can define the enum as you would normally do in Unity, then you have to add the [CustomEnum]
attribute to the enum class.
using EasyGameLobby.Infrastructure;
[CustomEnum]
public enum MyCustomEnum
{
Value1,
Value2,
Value3
}
Now you can open the Lobby Custom Values
window and add a new custom value with the type Enum
and under its settings, you will see the enum you just created.