Initial import
This commit is contained in:
28
Assets/Scripts/Authoring/ProjectileAuthoring.cs
Normal file
28
Assets/Scripts/Authoring/ProjectileAuthoring.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
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
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user