示例#1
0
        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"));
        }
示例#2
0
        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"));
        }