Quantcast
Channel: Programming (In-game)
Viewing all articles
Browse latest Browse all 903

Calling enum by index does not work

$
0
0
Whenever in my script I try to use a "(EnumName)SomeCalculatedInt" expression I receive an error inside ingame complier - "The type or namespace name 'EnumName' could not be found (are you missing a using directive or an assembly reference?)
Same happens when I use test with static values like "(EnumName)2".

I have some logic in the script based on the index of the enum but I do not want to use direct [int]EnumName in if statements as its harder to understand the script.

Viewing all articles
Browse latest Browse all 903

Trending Articles