get enum value c#
enum Colors { Red, Green, Blue };
enum Styles { Plaid = 0, Striped = 23, Tartan = 65 };
public static void Main() {
foreach(int i in Enum.GetValues(typeof(Colors)))
Console.WriteLine(i);
foreach(int i in Enum.GetValues(typeof(Styles)))
Console.WriteLine(i);
}
// OUTPUT:
// 0
// 1
// 2
//
// 0
// 23
// 65int something = (int) Question.Role;
Also in C#:
- no overload for 'useItemOnSceneLoad' matches delegate 'UnityAction<Scene, LoadSceneMode>'
- unity hide mouse
- change z value unity
- sqlite connection c#
- unity how to get data of play session time in a text file?
- C# type cast float to string
- c# pass mouse events to parent
- c# loop through array
- sort c#
- windows forms iterate through all controls
- : ? conditioanl statement c#
- c# resize image keep aspect ratio
- prefab gets character transform
- generic repository pattern c#
- set int to null c#
- c# list string return concatenate
- abstract class c#
- perlin noise unity
- c# regex replace
- freeze rotation in code c#
- class selector to property in asp net core dropdown
- c# clear list items
- wpf binding ancestor codebehind
- list of vectors c#