public void UpdateCoinPanel(List <PieceInfo> pieces, bool is_player) { int user_id = PlayerSession.user_id; if (transform.childCount > 0) { foreach (Transform child in transform) { GameObject go = child.gameObject; CoinPlaceController coin = go.GetComponent <CoinPlaceController>(); coin.piece_id = 0; coin.is_myplayer_piece = false; coin.DeleteCoin(); } } int counta = 0; foreach (PieceInfo piece in pieces) { if (!piece.captured) { continue; } if (piece.owner_user_id == user_id && !is_player) { continue; } if (piece.owner_user_id != user_id && is_player) { continue; } counta += 1; int width = counta % 4; int height = counta / 4 + 1; GameObject go = transform.Find("coin_place_clone_" + height + "" + width).gameObject; CoinPlaceController init_coin = go.GetComponent <CoinPlaceController>(); init_coin.piece_id = piece.piece_id; init_coin.is_myplayer_piece = false; init_coin.UpdateCoinPlace(init_coin.CoinId(piece.kind)); } }
public void UpdateCoinPanel(List <PieceInfo> pieces, bool is_first) { if (transform.childCount > 0) { foreach (Transform child in transform) { GameObject go = child.gameObject; CoinPlaceController coin = go.GetComponent <CoinPlaceController>(); coin.piece_id = 0; coin.is_myplayer_piece = false; coin.DeleteCoin(); } } foreach (PieceInfo piece in pieces) { if (piece.captured) { continue; } int width = piece.point_x + 1; int height = piece.point_y; if (!is_first) { width = 9 - width; height = 7 - height; } Debug.Log("coin_place_clone_" + height + "" + width); GameObject go = transform.Find("coin_place_clone_" + height + "" + width).gameObject; CoinPlaceController init_coin = go.GetComponent <CoinPlaceController>(); init_coin.piece_id = piece.piece_id; init_coin.is_myplayer_piece = piece.kind != "unknown"; init_coin.UpdateCoinPlace(init_coin.CoinId(piece.kind)); } }
// idou void MoveToEmptyPlace() { EndCoinPlaceController.UpdateCoinPlace(StartCoinPlaceController.coin_id); StartCoinPlaceController.UpdateCoinPlace(0); }