Hi guys, I am working on halo effect now.
I can either add halo component directly like this:
Or I can add a light component and the check drawHalo config in it.
The desired effect shows below:

Since I need to control this dynamically, I have to do it via script instead of changing the settings in Inspector.
The normal way like gameObject.AddComponent<Halo>();
or gameObject.GetComponent<Light>.drawHalo = true;
doesn’t work.
I’ve read many existing answers and solutions but none of them solve the problem so well.
PLZ someone helps me. Thx a lot!
Update:
I’ve figured out how to check the drawHalo config during runtime (simply with the code below). But still I don’t know how to add halo component to game object. Anyone help? Thanks!
haloName.FindProperty("m_DrawHalo").boolValue = true;
haloName.ApplyModifiedProperties();```


