Cheers! I had a two enums, describing my entityes: Players and guns types:
public enum PlayersType {
Scout,
Tank
}
public enum GunsType {
Machinegun,
Tesla
}
I had a generic a struct generic class, and 2 realizations of it:
public class EntityType<T> where T: struct, IConvertible {
public GameObjectType ObjectType;
}
public class PlayerEntity: EntityType<PlayersType> { }
public class TowerEntity: EntityType<GunsType> { }
And i want to create class, who has EntityType field and inherite ScriptableObject class.
I did this:
public class ObjectTypeConfig: ScriptableObject
{
public EntityType<Enum> EntityType;
}
But its return error:
The type 'System.Enum' must be a non-nullable value type in order to use it as type parameter `T' in the generic type or method.
Does anyone know how can i create necessary field? As a result i'm want to create Class, who will be has a Array of ObjectTypeConfigs, containing Players and Towers Entitiyes.