get gameobject thata script is on, unity code example
Example: c# unity gameObject.script
void Update()
{
string Thing = gameObject.GetComponent<CustomScriptName>().Variable;
if (Thing == "String1")
{
DoStuff();
}
if (Thing == "String2")
{
DoOtherStuff();
}
}