最简单的方法,在你这个物体挂载的脚本里面添加一个单例:
public class Test : MonoBehaviour
{
private static Test instance;
public static Test Instance
{
get { return instance; }
}
void Awake()
{
instance = this;
}
}
这样写了之后,就可以在其他类里面用过单例调用了:Test.Instance.方法();