public class Test1 : MonoBehaviour
{
//定义
private Test2 script;
void Start()
{
//赋值
script = GameObject.Find("Sphere").GetComponent<Test2>();
}
void Update()
{
//调用
script.PlayerMove("wang");
}
}
public class Test2 : MonoBehaviour
{
public void PlayerMove(string name)
{
}
}