Im trying to create component controller where i can add component/enable/disable them via script. To give idea why its like that i will tell use of it.
I have lot of Camera filter scripts and to make it possible to execute these filters ingame its much more efficient to just drag in some filters in control script for testing then changing them and so on… But atm i cant do it because i have to know what type of script/component it is and its very ineffective way if i have to change code everytime
What i tried to do and failed in this code.
None of these lines give me access to Behavior properties like “enable”.
Is there some way how to achieve what i want or i have to go some entirely other way ?
public Component[ ] comps; // assign in editor
public void EnableComponent(int i){
comps .enabled = true; // enable not supported
GetComponent (comps .GetType ()).enabled = true; // enable not supported
}