I have a class that supposedly handles generation of a unique ID of uint type. However upon multiple use, the uint value does not seem to increment.
static class UniqueIdGenerator
{
public static uint nextUnique;
public static uint GetNextUnique()
{
nextUnique++;
return nextUnique;
}
}
This class is used to assign a unique integer ID whenever it's called on other classes. e.g. both of the sample constructors below have an ID property that's supposed to get its value from the UniqueIdGenerator class
public Car()
{
carNumber = UniqueIdGenerator.GetNextUnique();
}
public Boat()
{
boatNumber = UniqueIdGenerator.GetNextUnique();
}