这个报的空指针错误,应该是GameManager.Instance为空,检查一下GameManager里面Instance怎么赋值的
private static GameManager _instance;
public static GameManager Instance
{
get { return _instance; }
}
private BoxCollider2D rightWall;
private BoxCollider2D leftWall;
private BoxCollider2D downWall;
private BoxCollider2D upWall;
public Transform Player1;
public Transform Player2;
private int score1;
private int score2;
public Text score1Text;
public Text score2Text;
void Aawke()
{
_instance = this;
}