Example #1
0
        public static BaseComponent LoadFromDefinition(ContentManager content, string definitionPath, BaseEntity parent)
        {
            LightComponentDefinition compDef = content.Load <LightComponentDefinition>(definitionPath);

            LightEmitterComponent newComponent = new LightEmitterComponent(parent, compDef);

            return(newComponent);
        }
Example #2
0
        /// <summary>
        /// Create a light emitter
        /// </summary>
        /// <param name="parent">Entity this light belongs to.</param>
        /// <remarks>Not meant to be called by anything but the ComponentLoader</remarks>
        public LightEmitterComponent(BaseEntity parent, LightComponentDefinition settings)
            : base(parent)
        {
            this.ambientColor  = settings.AmbientColor;
            this.specularColor = settings.SpecularColor;
            this.SpecularPower = settings.SpecularPower;
            this.diffuseColor  = settings.DiffuseColor;

            this.direction = settings.LightDirection;
        }