public static LightGameObject CreatePointLight(IEntityManager manager, Vector3 position) // { var tag = new ElementTag("PointLight_" + Interlocked.Increment(ref lights)); manager.CreateEntity(tag) .AddComponents( LightComponent.CreatePoint(0.4f, 1, position), ColorComponent.CreateDiffuse(new Vector4(1, 1, 1, 1)) ); return(new LightGameObject(tag, "PointLight")); }
public static LightObject CreatePointLight(IEntityManager manager, Vector3 position) // { var index = 1; if (!occupiedIndex.Add(index)) { throw new LightIndexOccupiedException(index); } var tag = new ElementTag("PointLight_" + Interlocked.Increment(ref lights)); manager.CreateEntity(tag) .AddComponent(LightComponent.CreatePoint(0.4f, index, position)) .AddComponent(ColorComponent.CreateDiffuse(new Vector4(1, 1, 1, 1))); return(new LightObject(tag, "PointLight")); }