19 lines
515 B
C#
19 lines
515 B
C#
using Unity.Entities;
|
|
|
|
public class FishSpawnerBaker : Baker<FishSpawnerAuthoring>
|
|
{
|
|
public override void Bake(FishSpawnerAuthoring authoring)
|
|
{
|
|
Entity entity = GetEntity(authoring.fishPrefabGO, TransformUsageFlags.Dynamic);
|
|
Entity entity2 = GetEntity(TransformUsageFlags.None);
|
|
FishSpawner component = new FishSpawner
|
|
{
|
|
prefab = entity,
|
|
spawnCount = authoring.spawnCount,
|
|
areaSize = authoring.areaSize,
|
|
position = authoring.transform.position
|
|
};
|
|
AddComponent(entity2, in component);
|
|
}
|
|
}
|