29 lines
755 B
C#
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
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|