- Home /
Question by
GiacomInox · Mar 16, 2021 at 03:55 PM ·
c#scripting probleminterface
Find all scripts attached to an object that implement a certain interface
I have a Clickable
interface and a ClickManager
script attached to my GameManager to save raycasts. When a cast hits an object, i'd like to get an array of all the instances of scripts that implement the interface that are attached to the object.
Is there a way to do it?
Comment
Best Answer
Answer by GiacomInox · Mar 16, 2021 at 04:54 PM
After fixing an unrelated problem it turns out that obj.GetComponent<Clickable>()
does the job
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
What the variable motorSetter and motor type should be ? 1 Answer
How do I delay an Ad? 2 Answers
Saving JSON file in Android,How to save json file in android 0 Answers