Hi my problem is ; I am using unity 5.5 and i couldnt find how to declare or crate a state in visual studio.Thanks for help
Hi @Sarper_Dundar,
I’m assuming you mean with the enums, if so, it’s the same as shown in the course;
// Enumeration of our different states of the game
private enum States { cell, mirror, sheets_0, lock_0};
Note, I have shortened the full list of states that you create in the course.
To break down what is being stated in the above;
-
private
is what is known as an access modifier, it determines the scope of access, in this case to the State enum. -
enum
is a keyword which is used to declare an enumeration. -
State
in this example is the name of the enumerated list. -
The { and } characters are used to contain our enumerator list (a set of named constants), each item is comma separated.
I hope this helps.
See also;
- MSDN : Access Modifiers
- MSDN : enum (C# Reference)
thanks for help i have rewatch video and i have missed a part we declare “State” with enum.Thats why when i write “State” in compiler it didnt respon to that.
Aha!
Glad you’ve resolved the issue and can move forward again