xxxxxxxxxx
// Assuming you want to get a reference to a script named "MyScript" on a game object named "myObject"
// Option 1: If you know the script is present on the object
MyScript script = myObject.GetComponent<MyScript>();
// Option 2: If you are not sure if the script is present on the object
MyScript script = myObject.GetComponentInChildren<MyScript>();
xxxxxxxxxx
ComponentClass component = GetComponent<ComponentClass>();
//not the file name