Files
EE2Clone/Assets/Scripts/Authoring/ProjectileAuthoring.cs
ldbetteridge 58da5d1d71 Initial import
2026-03-31 15:59:23 +01:00

29 lines
755 B
C#

using Unity.Entities;
using UnityEngine;
using EE2Clone.Components;
namespace EE2Clone.Authoring
{
public class ProjectileAuthoring : MonoBehaviour
{
public float Speed = 20f;
public class Baker : Baker<ProjectileAuthoring>
{
public override void Bake(ProjectileAuthoring authoring)
{
var entity = GetEntity(TransformUsageFlags.Dynamic);
AddComponent(entity, new ProjectileTag());
AddComponent(entity, new ProjectileData
{
Target = Entity.Null,
Damage = 0,
Speed = authoring.Speed,
OwnerPlayerId = 0
});
}
}
}
}