//When added, set up the light. public override void OnAdd(Entity owner) { base.OnAdd(owner); _light = IoCManager.Resolve <ILightManager>().CreateLight(); IoCManager.Resolve <ILightManager>().AddLight(_light); _light.SetRadius(_lightRadius); _light.SetColor(255, (int)_lightColor.X, (int)_lightColor.Y, (int)_lightColor.Z); _light.Move(Owner.GetComponent <TransformComponent>(ComponentFamily.Transform).Position + _lightOffset); _light.SetMask(_mask); Owner.GetComponent <TransformComponent>(ComponentFamily.Transform).OnMove += OnMove; }
//When added, set up the light. public override void OnAdd(Entity owner) { base.OnAdd(owner); _light = IoCManager.Resolve<ILightManager>().CreateLight(); IoCManager.Resolve<ILightManager>().AddLight(_light); _light.SetRadius(_lightRadius); _light.SetColor(255, (int) _lightColor.X, (int) _lightColor.Y, (int) _lightColor.Z); _light.Move(Owner.GetComponent<TransformComponent>(ComponentFamily.Transform).Position + _lightOffset); _light.SetMask(_mask); Owner.GetComponent<TransformComponent>(ComponentFamily.Transform).OnMove += OnMove; }
protected void SetMask(string mask) { _light.SetMask(mask); }