Esempio n. 1
0
    public ChessCfg GetConfig(int configID)
    {
        ChessCfg config = null;

        m_data.TryGetValue(configID, out config);
        return(config);
    }
Esempio n. 2
0
    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);
    }
Esempio n. 3
0
    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]);
    }
Esempio n. 4
0
 private void OnReadRow(ChessCfg obj)
 {
     m_data[obj.ID] = obj;
 }