public PostProcessingEffect(PostprocessingType type, bool active, Effect effect, Vector3 position = default(Vector3)) { Id = _counter++; Type = type; _active = new[] { active, active, active, active }; Effect = effect; Position = position; }
/// <summary> /// Remove all shaders with the given type. (Usually to cleanup) /// </summary> /// <remarks>Only shaders which are not fix by initialization are removed.</remarks> /// <param name="shader">Shader-type</param> public void RemoveShader(PostprocessingType shader) { if (_fixEffects.ContainsKey(shader) && _fixEffects.ContainsKey(shader)) { return; } _effects.RemoveAll(item => item.Type == shader); }
/// <summary> /// Set the state of a specific shader for a given player <paramref name="playerId"/>. /// </summary> /// <param name="shader">Shader-type</param> /// <param name="playerId">Id of the player</param> /// <param name="active">New state of the shader</param> public void SetShaderStatus(PostprocessingType shader, int playerId, bool active) { foreach (PostProcessingEffect postProcessingEffect in _effects) { if (postProcessingEffect.Type == shader) { postProcessingEffect.Activate(playerId, active); } } }