/*
 *Copyright(C) 2023 by Chief All rights reserved.
 *Unity版本：2022.2.0b14 
 *作者:Chief  
 *创建日期: 2022-12-07 
 *模块说明：Aster示例：Baking
 *版本: 1.0
*/

using Unity.Entities;

namespace Aster.Sample
{
    /// <summary>
    /// 生成代码
    /// </summary>
    public class SampleBaker : Baker<SampleBakerAuthoring>
    {
        public override void Bake(SampleBakerAuthoring authoring)
        {
            var entity = GetEntity(TransformUsageFlags.Dynamic);
            AddComponent(entity, new ASampleData_ID(authoring.GetIndex));
            var go = GetEntity(authoring.gameObject, TransformUsageFlags.Dynamic);
            AddComponent(entity, new SpawnerData() { gameObject = go, SpawnRate = 2 });
        }

    }
}