[user error] ECS Tutorial has type error?
tkgalk opened this issue · comments
Tomasz Galkowski commented
Specifically this line: var config = SystemAPI.GetSingleton<Config>();
in https://github.com/Unity-Technologies/EntityComponentSystemSamples/tree/master/DOTS_Guide/ecs_tutorial.
The issue is that config.TankCount
nor config.TankPrefab
are not valid because config
is of type Entity
(that's what SystemAPI.GetSingleton<Config>()
seem to be returning) instead of type Config
. Casting it to Config
didn't help either.
Tomasz Galkowski commented
var config = SystemAPI.GetSingleton<Config>();
Never mind, I'm dumb. I was using GetSingletonEntity
instead of GetSingleton
. That method does what has to be done, and that's the one that should be used. The tutorial is right, I can't read.