I am trying to follow an oldish tutorial about ECS and come up to a problem I have not been able to find an answer to.
I am using 2023.2 editor and Entities 1016 and need to add an entity derived from a game object that contains a reference to a prefab connected in the Inspector.
The tutorial uses GetEntity but that is Obsolete so need an alternative,
I have done some searching but keep getting stuck with out of date solutions.
Can someone give me a simple example to replace this line of code
TombstonePrefab = GetEntity(authoring.TombstonePrefab)
in this sample
AddComponent(entity, new GraveyardProperties
{
FieldDimensions = authoring.FieldDimensions,
NumberTombstonesToSpawn = authoring.NumberTombstonesToSpawn,
ZombieSpawnRate = authoring.ZombieSpawnRate,
TombstonePrefab = GetEntity(authoring.TombstonePrefab) // this is the error line
});
where the source TombstonePrefab is defined in the parent class (authoring) as a GameObject
“Entities 1016” is not a thing. You probably mean 1.0.16. You should refer to it this way.
2023.2 can mean a number of editor versions. Be specific, like 2023.2.3f1.
Did you read the message defined for the ObsoleteAttribute on the obsolete method? That message tells you what to do.
Sorry, I did another read through and realised I had already got the flags to be able to get where I was so added them as the second parameter and the obsolete has gone away.