Any way to get this to work (c#)?
public enum Stats {Strength, Intelligence, Wisdom, NUM_STATS};
private int[Stats.NUM_STATS as int];
Any way to get this to work (c#)?
public enum Stats {Strength, Intelligence, Wisdom, NUM_STATS};
private int[Stats.NUM_STATS as int];
I would not recommend doing it like this.
Better do it like this:
using UnityEngine;
using System.Collections;
public class test : MonoBehaviour {
public enum myenum
{
value1,
value2
}
// Use this for initialization
void Start () {
Debug.Log(System.Enum.GetValues(typeof(myenum)).Length);
}
}
using UnityEngine;
using System.Collections;
public class test : MonoBehaviour {
public enum myenum
{
value1 = 0,
value2,
NumberOfTypes
}
// Use this for initialization
void Start () {
Debug.Log((int)myenum.NumberOfTypes);
}
}