sábado, 21 de maio de 2016

BP Compendium 2: Enumerations

Enumerations


An enumeration is a set of constants with meaningful names that specifies all possible values a variable can have.

To create a new Enumeration click the "Add New" button and in the "Blueprints" submenu select "Enumeration".


Double-click the enumeration that was created to edit it. Click the "New" button to add the names that are part of the enumeration.


Now create a new variable in a Blueprint using the type of the enumeration that was created. Check the "Editable" option so that the value of the variable can be chosen in the level editor. The images below show an enumeration example created to represent the type of weapon.



There is a type of "Switch" action that determines the flow of execution in accordance with the value of the enumeration. In the example below "Weapon Type" is a variable of the enumeration type and "Weapon Mesh" is a Static Mesh component. The Static Mesh will be set according to the type of weapon.

Click to enlarge