Beispiel #1
0
    /// <summary>
    /// 文字列から内容を設定
    /// </summary>
    /// <param name="str"></param>
    /// <param name="sep"></param>
    public void FromFileString(string str, string sep)
    {
        string[] strs = str.Split(new String[] { sep }, StringSplitOptions.None);

        Name            = strs[0];
        X               = int.Parse(strs[1]);
        Y               = int.Parse(strs[2]);
        MapTileViewType = (MapTileViewType)MapTileViewType.Parse(typeof(MapTileViewType), strs[3], true);
    }
Beispiel #2
0
    /// <summary>
    /// ファイル出力用文字列に変換
    /// </summary>
    /// <param name="sep"></param>
    /// <returns></returns>
    public string ToFileString(string sep)
    {
        string str = "";

        str += Name + sep;
        str += X + sep;
        str += Y + sep;
        str += MapTileViewType.ToString();

        return(str);
    }
Beispiel #3
0
    /// <summary>
    /// マップタイルを交換する
    /// </summary>
    /// <param name="bmt"></param>
    /// <param name="viewType"></param>
    private void ChangeMapTile(BattleMapTile bmt, MapTileViewType viewType)
    {
        bmt.MapTileViewType = viewType;

        // 既存のGameObjectを破棄
        Destroy(bmt.GameObject);

        // 新規にGameObjectを作成
        GameObject go = prefabHolder.Instantiate(bmt);

        bmt.GameObject = go;

        // マップ上にオブジェクトを設置
        mapObjectGenerator.DecoreteMapTile(bmt);
    }