void Awake() { this.table_board = new List <short>(); this.available_attack_cells = new List <short>(); this.graycell = Resources.Load("images/graycell") as Texture; this.focus_cell = Resources.Load("images/border") as Texture; this.blank_image = Resources.Load("images/blank") as Texture; this.game_board = Resources.Load("images/gameboard") as Texture; this.background = Resources.Load("images/gameboard_bg") as Texture; this.img_players = new List <Texture>(); this.img_players.Add(Resources.Load("images/red") as Texture); this.img_players.Add(Resources.Load("images/blue") as Texture); this.win_img = Resources.Load("images/win") as Texture; this.lose_img = Resources.Load("images/lose") as Texture; this.draw_img = Resources.Load("images/draw") as Texture; this.gray_transparent = Resources.Load("images/gray_transparent") as Texture; this.board = new List <short>(); this.network_manager = GameObject.Find("NetworkManager").GetComponent <CNetworkManager>(); this.game_state = GAME_STATE.READY; this.main_title = GameObject.Find("MainTitle").GetComponent <CMainTitle>(); this.score_images = gameObject.AddComponent <CImageNumber>(); this.win_player_index = byte.MaxValue; this.draw = this.on_gui_playing; this.battle_info = gameObject.AddComponent <CBattleInfoPanel>(); }
void clear() { this.current_player_index = 0; this.step = 0; this.draw = this.on_gui_playing; this.is_game_finished = false; }
void on_game_over(CPacket msg) { this.is_game_finished = true; this.win_player_index = msg.pop_byte(); this.draw = this.on_gui_game_result; }