// PUBLIC public void ChangeColorsUsingSettings(TeamColorSettings settings) { foreach (var meshRenderer in _meshRenderers) { meshRenderer.material.SetColor("_BaseColor", _colorSettings.ItemsColor); meshRenderer.material.SetColor("_Color", _colorSettings.ItemsColor); } foreach (var light in _lights) { light.color = _colorSettings.ItemsColor; } foreach (var trail in _trails) { trail.startColor = _colorSettings.ItemsColor; } foreach (var decal in _decals) { /* * //Material material = new Shader(Shader.Find("HDRenderPipelin/Unlit")); * var newMat = new Material(decal.m_Material); * decal.m_Material = newMat; * //decal.m_Material.color = _colorSettings.ItemsColor; * decal.m_Material.SetColor("_BaseColor",_colorSettings.ItemsColor); */ } }
// CORE private void Awake() { _colorSettings = Resources.Load <PlayerSettings>(Constants.Resources.PlayerSettings).ColorSettings; }