• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# MapData类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中MapData的典型用法代码示例。如果您正苦于以下问题:C# MapData类的具体用法?C# MapData怎么用?C# MapData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MapData类属于命名空间,在下文中一共展示了MapData类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: BuildMap

    public void BuildMap()
    {
        //����������
        m_map = new MapData[MapSizeX, MapSizeZ];

        for (int i = 0; i < MapSizeX; i++)
        {
            for (int k = 0; k < MapSizeZ; k++)
                m_map[i, k] = new MapData();
        }

        // �������TagΪgridnode�Ľڵ�
        GameObject[] nodes = (GameObject[])GameObject.FindGameObjectsWithTag("gridnode");

        foreach (GameObject nodeobj in nodes)
        {
            //��ýڵ�
            GridNode node = nodeobj.GetComponent<GridNode>();

            Vector3 pos = nodeobj.transform.position;

            //����ڵ��λ�ó���������Χ�������
            if ((int)pos.x >= MapSizeX || (int)pos.z >= MapSizeZ)
                continue;

            //���ø��ӵ�����
            m_map[(int)pos.x, (int)pos.z].fieldtype = node._mapData.fieldtype;

        }
    }
开发者ID:Wholanz,项目名称:Tower,代码行数:30,代码来源:GridMap.cs


示例2: GridUpdate

    void GridUpdate(SceneView sceneview)
    {
        e = Event.current;

        //Make sure MapData has been loaded
        _MapData = EditorHelper.CheckMapData(_MapData);

        //If a Grid exists place tiles
        if (EditorHelper.GridExsists())
        {
            if(grid == null)
            {
                grid = GameObject.FindObjectOfType<DrawGrid>();
            }

            if (EditorHelper.InsideGrid(EditorHelper.GetMousePosition(e)))
            {
                //if input is from a mouse and the mouse button was a left click event
                if (e.button == 0 && e.isMouse && e.type == EventType.MouseDown)
                {
                    PaintTile();
                }
            }
        }
    }
开发者ID:DanWeston626,项目名称:LevelEditor,代码行数:25,代码来源:GridEditorSceneView.cs


示例3: GetMapData

		internal protected override object GetMapData (object[] attributes, string scope)
		{
			DataType itemDataType = null;
			Type itemType = null;
			
			ItemPropertyAttribute at = FindPropertyAttribute (attributes, scope + "/*");
			if (at != null) {
				itemType = at.ValueType;
				if (itemType == null) itemType = handler.GetItemType ();
				if (at.SerializationDataType != null)
					itemDataType = (DataType) Activator.CreateInstance (at.SerializationDataType, new object[] { itemType });
			}
			
			if (itemType == null) itemType = handler.GetItemType ();
			if (itemDataType == null) itemDataType = Context.GetConfigurationDataType (itemType);

			object itemMapData = itemDataType.GetMapData (attributes, scope + "/*");
			if (at == null && itemMapData == null) return null;

			MapData data = new MapData ();
			data.ItemType = itemDataType;
			data.ItemName = (at != null && at.Name != null) ? at.Name : itemDataType.Name;
			data.ItemMapData = itemMapData;
			return data;
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:25,代码来源:CollectionDataType.cs


示例4: Node

        public Node(Node copie, NodePos direction, MapData map, Vector2 size)
        {
            CanGo = true;
            Start = copie.Start;
            Arrival = copie.Arrival;

            switch (direction)
            {
                case NodePos.U:
                    Position = new Vector2(copie.Position.X, copie.Position.Y - 32);
                    break;
                case NodePos.D:
                    Position = new Vector2(copie.Position.X, copie.Position.Y + 32);
                    break;
                case NodePos.R:
                    Position = new Vector2(copie.Position.X + 32, copie.Position.Y);
                    break;
                case NodePos.L:
                    Position = new Vector2(copie.Position.X - 32, copie.Position.Y);
                    break;
            }

            Update(map);
            if (Id < 0 || Id > map.MapWidth * map.MapHeight || !Can(direction, map, size))
                CanGo = false;
        }
开发者ID:wiilinkpds,项目名称:Wotrn,代码行数:26,代码来源:Node.cs


示例5: ReadCSVMap

	public void ReadCSVMap()
	{
		lstMapData = new List<MapData>();
		List<Dictionary<string, object>> data = CSVReader.Read("csv/" + FILE_CSV_MAP);
		MapData mapData;
		if (data != null)
		{
			for (int i = 0; i < data.Count; i++)
			{
				int id = (int)data[i]["id"];
				int idPattern = (int)data[i]["idPattern"];
				int idModel = (int)data[i]["idModel"];
				float positionX = float.Parse(data[i]["positionX"].ToString());
				float positionY = float.Parse(data[i]["positionY"].ToString());
				float positionZ = float.Parse(data[i]["positionZ"].ToString());
				float rotationX = float.Parse(data[i]["rotationX"].ToString());
				float rotationY = float.Parse(data[i]["rotationY"].ToString());
				float rotationZ = float.Parse(data[i]["rotationZ"].ToString());
				float scaleX = float.Parse(data[i]["scaleX"].ToString());
				float scaleY = float.Parse(data[i]["scaleY"].ToString());
				float scaleZ = float.Parse(data[i]["scaleZ"].ToString());
				mapData = new MapData(id,idPattern,idModel,new Vector3(positionX,positionY,positionZ),new Vector3(rotationX,rotationY,rotationZ),new Vector3(scaleX,scaleY,scaleZ));
				lstMapData.Add(mapData);
			}
		}
	}
开发者ID:at-anhgh,项目名称:Game-RiotSamuraFight,代码行数:26,代码来源:CreatMap.cs


示例6: TryGetMapData

        public bool TryGetMapData(string signText, string worldOwner, out MapData mapData)
        {
            signText = signText.Trim();
            mapData = null;

            if (!signText.StartsWith(ScanText, StringComparison.OrdinalIgnoreCase))
                return false;

            signText = signText.Substring(ScanText.Length).Trim();
            var lowerText = signText.ToLower();

            // Try to find specified creators in text by searching for special text
            foreach (var byText in new[] {" by ", " by:"})
            {
                if (!lowerText.Contains(byText))
                    continue;

                var splitIndex = lowerText.LastIndexOf(byText, StringComparison.OrdinalIgnoreCase);

                // Name is before 'byText' and creators after
                mapData = new MapData(
                    signText.Substring(splitIndex).Trim(),
                    signText.Substring(splitIndex + byText.Length).Trim());

                return true;
            }

            mapData = new MapData(signText, worldOwner);

            return true;
        }
开发者ID:BotBitsExt,项目名称:MapManager,代码行数:31,代码来源:ScanSignFormat.cs


示例7: Create

        public static World Create(MapData mapData, LevelData newLevel, Game game, Rectangle screenRec)
        {
            var tilesetList = new List<Tileset>();
            foreach (TilesetData data in mapData.Tilesets)
            {
                tilesetList.Add(
                    TilesetFactory.Create(data, game)
                    );
            }

            var mapLayers = mapData.Layers.Select(l => MapLayer.FromMapLayerData(l)).ToList();

            // MUSTDO: modify TileMap to be able to accept multiple tile sets
            var map = new TileMap(tilesetList[0], mapLayers[0]);

            // SHOULDDO: find out why does map need tilesets to?
            for (int i = 1; i < tilesetList.Count; i++)
                map.AddTileset(tilesetList[i]);

            for (int i = 1; i < mapLayers.Count; i++)
                map.AddLayer(mapLayers[i]);

            var level = new Level(map);

            var world = new World(game, screenRec);
            world.Levels.Add(level);
            world.CurrentLevel = 0;

            return world;
        }
开发者ID:vkuts,项目名称:Gamesor,代码行数:30,代码来源:WorldFactory.cs


示例8: Generate

    public static MapData Generate()
    {
        MapData md = new MapData();

        md.Add(new FenceHMI(36,74));
        md.Add(new FenceHMI(112,-65));
        md.Add(new FenceHMI(-22,-98));
        md.Add(new FenceHMI(-237,-33));
        md.Add(new FenceHMI(-182,-93));
        md.Add(new FenceVMI(-189,73));
        md.Add(new FenceVMI(-48,-76));
        md.Add(new FenceVMI(165,-14));
        md.Add(new FenceVMI(84,-96));
        md.Add(new FenceVMI(61,97));
        md.Add(new FenceVMI(273,29));
        md.Add(new House1MI(52,-49));
        md.Add(new House1MI(132,32));
        md.Add(new House1MI(-160,120));
        md.Add(new House1MI(-183,-16));
        md.Add(new StartPosMI(-62,-134));
        md.Add(new StartPosMI(-257,127));
        md.Add(new StartPosMI(-45,132));
        md.Add(new StartPosMI(156,128));
        md.Add(new StartPosMI(189,-115));
        md.Add(new StartPosMI(237,27));
        md.Add(new StartPosMI(-272,32));
        md.Add(new StartPosMI(-228,-124));

        return md;
    }
开发者ID:BoarK,项目名称:BewareWolf,代码行数:30,代码来源:GeneratedMap.cs


示例9: RecordManager

    public RecordManager(string text)
    {
        string[] frameText = text.Split('\n');
        numFrames = frameText.Length - 1;

        //handle the first row
        string[] first_row_data = frameText[0].Split('|');
        string[] robotAIText = first_row_data[0].Split('*');
        robotAIData = new RobotAIData[robotAIText.Length];
        for(int i = 0; i<robotAIText.Length; i++)
        {
            robotAIData[i] = new RobotAIData(robotAIText[i]);
        }
        mapData = new MapData(first_row_data[1],first_row_data[2],first_row_data[3]);

        string[] achievementText = first_row_data[4].Split('*');
        achievementData = new AchievementData[achievementText.Length];
        for(int i = 0; i<achievementText.Length; i++)
        {
            achievementData[i] = new AchievementData(achievementText[i]);
        }

        winnerID = Convert.ToInt32(first_row_data[5]);

        //handle the following frame rows
        frameData = new FrameData[numFrames];

        for(int i = 1; i < frameText.Length; i++)
        {
            frameData[i-1] = new FrameData(frameText[i]);
        }
    }
开发者ID:shrekshao,项目名称:MechEmpire-Clash,代码行数:32,代码来源:RecordManager.cs


示例10: GetRandomPosition

	Position GetRandomPosition(MapData mapData)
	{
		var position = new Position();
		position.column = GetRandomPositionDimension(mapData.Size);
		position.row = GetRandomPositionDimension(mapData.Size);
		return position;
	}
开发者ID:KarolStola,项目名称:ThePatfinder,代码行数:7,代码来源:CreateMapCommand.cs


示例11: Start

        void Start()
        {
            MapData data = new MapData();
            data.Deserialize(map);

            Json_MasterParam master = LitJson.JsonMapper.ToObject<Json_MasterParam>(json.text);
            Json_CalenderParam d = master.calender;
            CalenderParam cp = new CalenderParam();
            cp.Desrialize(d);
            int year = cp.Year;

            width = data.mMapData.Width;
            height = data.mMapData.Height;
            types = data.mMapData.MapData;
            for (int h = 0; h < height; ++h)
            {
                for (int w = 0; w < width; ++w)
                {
                    //Debug.Log(h * height + w);

                    if (types[h * height + w] == FloorType.Hatake)
                    {
                        GameObject obj = Instantiate<GameObject>(hatake);
                        obj.transform.position = new Vector3((float)w, 0.1f, (float)height - h);
                        obj.transform.rotation = new Quaternion();
                    }
                }
            }
        }
开发者ID:Crokan,项目名称:ROGUE,代码行数:29,代码来源:GameScene.cs


示例12: getBoard_RandomContent

 public static MapData getBoard_RandomContent(int w, int h)
 {
     var d = new MapData(w, h);
     d.setRandomMatches(10);
     d.doUpdateMatches();
     return d;
 }
开发者ID:kyung01,项目名称:UnityProject1,代码行数:7,代码来源:MapGenerator.cs


示例13: CheckMapData

 /// <summary>
 /// Checks if the passed MapData has been initialized
 /// if it has not CheckMapData calls CreateMapData and loads
 /// the resource path to the reference
 /// </summary>
 /// <param name="_MapData"></param>
 /// <returns></returns>
 public static MapData CheckMapData(MapData _MapData)
 {
     if (_MapData == null)
     {
         CreateMapData(out _MapData);
     }
     return _MapData;
 }
开发者ID:DanWeston626,项目名称:LevelEditor,代码行数:15,代码来源:EditorHelper.cs


示例14: Init

 public static void Init()
 {
     EditorHelper.CreateMapData(out _MapData);
     _MapData = Resources.Load<MapData>("GameData/MapData");
     MapToolsEditor window = (MapToolsEditor)EditorWindow.GetWindow(typeof(MapToolsEditor));
     window.title = "Map Tools";
     window.Show();
 }
开发者ID:DanWeston626,项目名称:LevelEditor,代码行数:8,代码来源:MapToolsEditor.cs


示例15: MapRefData

 public MapRefData(MapData toAdd)
 {
     RepresentationLabel = toAdd.Geometry.RepresentationLabel;
     EntityLabel = toAdd.Product.EntityLabel;
     EntityTypeId = IfcMetaData.IfcTypeId(toAdd.Product);
     SurfaceStyleLabel = toAdd.Geometry.SurfaceStyleLabel;
     Matrix = XbimMatrix3D.Multiply(toAdd.Geometry.Transform, toAdd.Matrix);
 }
开发者ID:bnaand,项目名称:xBim-Toolkit,代码行数:8,代码来源:XbimMesher.cs


示例16: GetDefaultData

		protected virtual MapData GetDefaultData ()
		{
			if (defaultData != null) return defaultData;
			defaultData = new MapData ();
			defaultData.ItemType = Context.GetConfigurationDataType (handler.GetItemType ());
			defaultData.ItemName = defaultData.ItemType.Name;
			return defaultData;
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:8,代码来源:CollectionDataType.cs


示例17: Init

    static void Init()
    {
        _MapData = Resources.Load<MapData>("GameData/MapData");

        SpriteSheetEditor _SpriteSheetEditor = (SpriteSheetEditor)EditorWindow.GetWindow(typeof(SpriteSheetEditor));
        _SpriteSheetEditor.title = "Sprite Sheet";
        _SpriteSheetEditor.Show();
    }
开发者ID:DanWeston626,项目名称:LevelEditor,代码行数:8,代码来源:SpriteSheetEditor.cs


示例18: TileCollisionGenerator

	public TileCollisionGenerator(MapData mapData)
	{
		this.mapData = mapData;

		meshes = new List<Mesh>();

		MakeMesh();
	}
开发者ID:Cloverseer,项目名称:Artificial-Intelligence-for-Game-Development,代码行数:8,代码来源:TileCollisionGenerator.cs


示例19: SetMapData

 public void SetMapData(message.CrashMapData temp)
 {
     if(_map_data == null)
     {
         _map_data = new MapData();
     }
     _map_data.set_info(temp);
 }
开发者ID:kingstop,项目名称:crashmo,代码行数:8,代码来源:global_instance.cs


示例20: LoadMap

 public void LoadMap(string filePath)
 {
     //TODO LOAD THIS
     mapData = MapData.Load(filePath);
     // copy the map data array
     world = (MapTile[,])mapData.map.Clone();
     // create this mesh
     MapGenerator.singleton.CreateLoadedWorldMesh(new Vector2(mapData.mapSizeX,mapData.mapSizeY));
 }
开发者ID:kingatlasg,项目名称:NCTGameJam1,代码行数:9,代码来源:WorldController.cs



注:本文中的MapData类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# MapEntityIndex类代码示例发布时间:2022-05-24
下一篇:
C# MapControl类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap