Attach UI to Component Via Script

enter image description here

I want to attach the UI to the MC_Streaming Option Script via Code .

enter image description here

What i wanted here is that this live_onOff will go to the Livestream(MC_Streaming Option) without dragging it . And i don't know where to start.

PS: The MC_Streaming Option script is being attached only when the program run

MC_StreamingOption mcStreamingOption = gameObject.AddComponent<MC_StreamingOption>();

1 answer

  • answered 2018-02-13 03:35 NoobProgrammer

    I find a way out . Thanks anyways guys. I just attach manually the live_onOff to UIButton and uses a DestroyImmediate() for my logic and it suited very well . Thankyou.