Access halo component / enable drawHalo in light component via script

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:
5884016--626927--upload_2020-5-22_16-3-53.png
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();```

![5884016--626912--upload_2020-5-22_15-49-55.png|390x513](upload://pkVYgOFt9nzuJ0ca55ThcRM1Qux.png)
![5884016--626921--upload_2020-5-22_15-52-51.png|390x871](upload://7Ksnr20ls4oGbkB1naNfcPrfPp2.png)
![5884016--626924--upload_2020-5-22_15-53-18.png|382x309](upload://vanO8IS6GsNAWsVVaZn5qaGTvzN.png)

Here is what I would do:

public Light YourLight;

void Start()
{
YourLight.enabled = true;
}

This works for me, but you may have to use a public LightSource variable instead.

Thank you. Now I need to manage to add a halo component to a random game object, even when it doesn’t have a light component. Do you have any ideas? Thanks a lot.