public ChessCfg GetConfig(int configID) { ChessCfg config = null; m_data.TryGetValue(configID, out config); return(config); }
public void InitChess(Chess chess) { chessObj = chess; chessCfg = ConfigManager.Get <ChessCfgLoader>().GetConfig((int)chessObj.chess_id); if (chessCfg == null) { return; } this.gameObject.name = string.Format("{0} -- {1}", chess.chess_id, chess.id); Ready = false; this.transform.localPosition = new Vector3(ChessInterval * chess.chess_index_x, 0, ChessInterval * chess.chess_index_z); this.transform.localScale = Vector3.one * 2; HP = (int)chessObj.max_hp; StartCoroutine(InitChessInternale()); GUIManager.GetView <ChessInfoUIPanel>("ChessInfoUIPanel").ShowChessInfo(this); }
public static System.Type GetEntityTypeByConfigID(int configID) { ChessCfg cfg = ConfigManager.Get <ChessCfgLoader>().GetConfig(configID); if (cfg == null) { return(typeof(ChessEntity)); } string script = cfg.Script; if (string.IsNullOrEmpty(script)) { return(typeof(ChessEntity)); } if (!entityTypeMap.ContainsKey(script)) { return(typeof(ChessEntity)); } return(entityTypeMap[script]); }
private void OnReadRow(ChessCfg obj) { m_data[obj.ID] = obj; }