An “enum” allows you to define a set of named constants, which in this case represent the different states that an enemy can be in. The constants are given integer values automatically by the compiler, starting with zero and incrementing by one for each subsequent constant.
In this specific script, the “State” enum is used to define the different states that an enemy can be in. Currently, there is only one state defined: “Roaming.” This means that the enemy is currently wandering around aimlessly, looking for the player.
The “Roaming” command is simply identifying this state as a string, as you mentioned. It does not hold any special meaning in Unity itself; it’s just a convenient way to refer to this particular state within the script.
In summary, the “enum” keyword is used to define a custom data type with a set of named constants, which are used to represent different states that an object (in this case, an enemy) can be in. In this script, the “State” enum defines a single state called “Roaming,” which represents the enemy wandering around aimlessly.
This is what I found, hope this helps!