using Unity.Entities; using UnityEngine; using EE2Clone.Components; using EE2Clone.Core; namespace EE2Clone.Authoring { public class ResourceNodeAuthoring : MonoBehaviour { public ResourceType ResourceType = ResourceType.Food; public int StartingAmount = 500; public class Baker : Baker { public override void Bake(ResourceNodeAuthoring authoring) { var entity = GetEntity(TransformUsageFlags.Dynamic); AddComponent(entity, new ResourceNodeTag()); AddComponent(entity, new ResourceNode { Type = authoring.ResourceType, RemainingAmount = authoring.StartingAmount }); } } } }