KavTest/KavTest/Engines/Spawners/DirectionalLightSpawner.cs

19 lines
575 B
C#

using Encompass;
using KavTest.Components;
using KavTest.Messages;
using Microsoft.Xna.Framework;
namespace KavTest.Spawners
{
public class DirectionalLightSpawner : Spawner<DirectionalLightSpawnMessage>
{
protected override void Spawn(in DirectionalLightSpawnMessage message)
{
var entity = CreateEntity();
AddComponent(entity, new Transform3DComponent(new Transform3D(Vector3.Zero, message.Orientation)));
AddComponent(entity, new DirectionalLightComponent(message.Color, message.Intensity));
}
}
}