Home c# Declaring a variable with an enum?
Reply: 0

c# Declaring a variable with an enum?

user526
1#
user526 Published in May 22, 2018, 11:43 am
public enum States
{
    START,
    LOSE,
    WIN,
    PLAYERTURN,
    ENEMYTURN,
};

States CurrentState;

This the code I'm having trouble with.I'm trying to make a turn based system, but I can't seem to figure out how to define the variable "CurrentState". From what I've seen from others, using the enum and then the variable should work; I just get a compiler error. Am I doing something wrong?

This code is for Unity 2017.3.1; I am using Visual Studio to write my code.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.487027 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO