How do you use a Component slot?
,I don't want to use the GetComponent call and have to create multiple scripts or set booleans for which script I want to modify. But if you use a component slot, it doesn't know what script you want to modify variables from, and what variables it should look for. So this obviously doesn't work. What about just enabling something assigned to the slot though? It seems like you would be able to do this because all components have an enabled/active checkbox on them. However, even trying to set the Enabled on a component assigned to a general Component slot, it gives you red lines. How in the world do you use it?
Answer by Doctor_ED · May 18, 2019 at 11:31 AM
The question is, what do you want to achieve? You don't directly use a Component, as it's a base class. If you would try to get a "Component" from any GameObject, it would return the first one (probably transform) as everything that can be attatched to GameObject is a Component. 
 Your question is unclear. Do you want to check if given GameObject is what you are looking for? 
Your answer
 
             Follow this Question
Related Questions
Adding classes to objects 0 Answers
Problem with gravity with regidbody. 2 Answers
How to correctly handle NullReferenceException when using GetComponent<>? 1 Answer
Game Manager can't decide what the instance of the object is despite just making an instance of it 1 Answer
Get Component isn't working too well 1 Answer