private void ColorSelectorValueChanged(ModifyableColor modColor, Color newColor) { modColor.current = newColor; foreach (Renderer ren in modColor.colorRenderers) { ren.sharedMaterial.color = newColor; } }
private void Awake() { light = GetComponentInChildren <Light>(); lightColorModifier = GetComponent <Placeable>()?.modifyableColors.First(mc => mc.title.ToLower().Equals("light")); if (light == null || lightColorModifier == null) { Debug.LogError("Modifyable light failed initialization."); Destroy(gameObject); } }