不知道获取方法
目前使用获取方法
GameObject.Find("对象").GetComponent<脚本名>().变量名
运行结果及报错内容
Member 'Pass.gameplayers' cannot be accessed with an instance reference; qualify it with a type na
//无法使用具有实例引用的实例访问成员xxx;请改用类型名对其进行限定
GameObject.Find("对象").GetComponent<脚本名>().变量名
Member 'Pass.gameplayers' cannot be accessed with an instance reference; qualify it with a type na
//无法使用具有实例引用的实例访问成员xxx;请改用类型名对其进行限定
静态变量直接使用静态类名访问即可,如
public static class Aa
{
public static int a;
}
其他脚本访问:Aa.a;