public void SetLightMode(LightModeClass? mode, ILight light) { if (!mode.HasValue) { if (light.LightMode != null) { light.LightMode.OnRemove(light); light.LightMode = null; } return; } var modes = new List<LightMode>(); foreach (Type t in LightModes) { var temp = (LightMode) Activator.CreateInstance(t); if (temp.LightModeClass == mode.Value) { if (light.LightMode != null) { light.LightMode.OnRemove(light); light.LightMode = null; } light.LightMode = temp; temp.OnAdd(light); return; } } }
public PointLightComponentState(LightState state, Color color, LightModeClass mode, float radius, Vector2 offset) : base(NetIDs.POINT_LIGHT) { State = state; Color = color; Mode = mode; Radius = radius; Offset = offset; }
public LightComponentState(LightState state, int colorR, int colorG, int colorB, LightModeClass mode) : base(ComponentFamily.Light) { State = state; ColorR = colorR; ColorG = colorG; ColorB = colorB; Mode = mode; }
public PointLightComponentState(LightState state, int colorR, int colorG, int colorB, LightModeClass mode) : base(NetIDs.POINT_LIGHT) { State = state; ColorR = colorR; ColorG = colorG; ColorB = colorB; Mode = mode; }
protected void SetMode(LightModeClass mode) { IoCManager.Resolve <ILightManager>().SetLightMode(mode, _light); }
protected void SetMode(LightModeClass mode) { IoCManager.Resolve<ILightManager>().SetLightMode(mode, _light); }