Exemplo n.º 1
0
    public GameObject CreatePatternGameObject()
    {
        if (mapData != null && mapObjectData != null)
        {
            GameObject o = new GameObject();
            o.name = FileName;
            DrawingMap.DrawCells(mapObjectData.GetObjectEnumerator(), (int)assetSize.x, (int)assetSize.z, Vector3.zero, o);
            AssetCellData cellData = o.AddComponent <AssetCellData>();
            cellData.Size   = assetSize;
            cellData.Center = new Vector3(0, assetSize.y * 0.5f, 0);
            return(o);
        }

        return(null);
    }
Exemplo n.º 2
0
    static public GameObject DrawMap(MapData map, MapObjectData mapObject, Vector3 pos, Quaternion rot)
    {
        if (map == null || mapObject == null)
        {
            return(null);
        }

        return(DrawCells(mapObject.GetObjectEnumerator(), map.MapSizeX, map.MapSizeZ, pos));
    }
Exemplo n.º 3
0
    /// <summary>
    /// Init layer
    /// </summary>
    /// <param name="mapObjectData"></param>
    public void InitLayer(MapObjectData mapObjectData)
    {
        IEnumerator mapObjectItr = mapObjectData.GetObjectEnumerator();

        while (mapObjectItr.MoveNext())
        {
            MapObject mapObject = mapObjectItr.Current as MapObject;
            int       len       = mapObject.ObjectDataList.Count;
            for (int i = 0; i < len; i++)
            {
                MapObject.ObjectData obj = mapObject.ObjectDataList[i];
                string layerName         = obj.LayerName;
                AddObjectToLayer(layerName, obj);
            }
        }
    }