how to use a function from a scrpt of a gameobject into another class code example
Example: how to use a function from a scrpt of a gameobject into another class
GameObject go = GameObject.Find("somegameobjectname");
ScriptB other = (ScriptB) go.GetComponent(typeof(ScriptB));
other.DoSomething();