So, i got 2 scripts that attached to my GameObject. Both scripts has same names (Controller), difference is just in value of string variable - Name.
what should i do to get all scripts with name “Conroller” attached to my GameObject and check each value of variable Name of them
i tried:
MonoBehaviour[] eventScripts = other.GetComponents<Event>();
foreach (MonoBehaviour eventScript in eventScripts) {
Debug.Log (eventScript.EventName);
}
Where:
“Event” - name of my scripts (there is 2 scripts Event on gameObject)
“EventName” - variable that i need to check