private void Awake() { if (Instance == null) { _instance = this; } }
private void Awake() { if (_instance == null) { _instance = this; } grid = new int[Max_LINE, Max_LINE]; effectChess.SetActive(false); }
private void Start() { winText = GameObject.Find("win_Text").GetComponent <Text>(); board = GameObject.Find("棋盘").GetComponent <NetChessBoard>(); board.playerTurn = ChessType.Black; players = GameObject.FindGameObjectsWithTag("Player"); players[0].GetComponent <NetPlayer>().playerTurn = ChessType.Black; if (players.Length >= 2) { players[1].GetComponent <NetPlayer>().playerTurn = ChessType.White; } GameObject.Find("ReSet").GetComponent <Button>().onClick.AddListener(ResetChess); GameObject.Find("ReStart").GetComponent <Button>().onClick.AddListener(RestartChess); board.ipText.text = "本机IP:\n" + Network.player.ipAddress; }