Hi, my name is Julien, i’m student in graphic design and a beginner in Unity.
For my diploma project, i’m trying to create a black light with this code (Found it here : Pure black lighting - Questions & Answers - Unity Discussions) :
- using UnityEngine;
- [ExecuteInEditMode]
- [RequireComponent(typeof(Light))]
- public class HackedLight : MonoBehaviour {
- public Vector4 hackColor;
- public float multiplier = 1;
- void Update ()
- {
- var light = GetComponent();
- light.color = new Color(hackColor.x, hackColor.y, hackColor.z, hackColor.w) * multiplier;
- }
- }
But it seems it doesn’t work anymore on the recent version of Unity. By chance, is someone knows how to do it ? Is it still possible on Unity 2019 ?
Thank you for your reading,
Julien.