本文整理汇总了C#中Sector.Add方法的典型用法代码示例。如果您正苦于以下问题:C# Sector.Add方法的具体用法?C# Sector.Add怎么用?C# Sector.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sector
的用法示例。
在下文中一共展示了Sector.Add方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateSector
/// <summary>
/// Initializes a new sector with some default values.
/// </summary>
/// <param name="Name">Name of new sector.</param>
/// <returns>The created <see cref="Sector"/> object.</returns>
public static Sector CreateSector(string Name)
{
Sector sector = new Sector();
sector.Name = Name;
Tilemap tilemap = new Tilemap();
tilemap.Resize(100, 35, 0);
tilemap.Layer = -100;
tilemap.Name = "Background";
sector.Add(tilemap, true);
tilemap = new Tilemap();
tilemap.Resize(100, 35, 0);
tilemap.Layer = 0;
tilemap.Solid = true;
tilemap.Name = "Interactive";
sector.Add(tilemap, true);
tilemap = new Tilemap();
tilemap.Resize(100, 35, 0);
tilemap.Layer = 100;
tilemap.Name = "Foreground";
sector.Add(tilemap, true);
SpawnPoint spawnpoint = new SpawnPoint();
spawnpoint.X = 96;
spawnpoint.Y = 96;
spawnpoint.Name = "main";
sector.Add(spawnpoint, true);
Camera camera = new Camera();
sector.Add(camera, true);
sector.FinishRead(); //let sector detect it's dimensions
return sector;
}
示例2: CreateSector
/// <summary>
/// Initialises a new sector with some default values.
/// </summary>
/// <param name="Name">Name of new sector.</param>
/// <returns>The created sector.</returns>
public static Sector CreateSector(string Name)
{
Sector sector = new Sector();
sector.Name = Name;
Tilemap tilemap = new Tilemap();
tilemap.Resize(100, 35, 0);
tilemap.ZPos = -100;
tilemap.Name = "Background";
sector.Add(tilemap);
tilemap = new Tilemap();
tilemap.Resize(100, 35, 0);
tilemap.ZPos = 0;
tilemap.Solid = true;
tilemap.Name = "Interactive";
sector.Add(tilemap);
tilemap = new Tilemap();
tilemap.Resize(100, 35, 0);
tilemap.ZPos = 100;
tilemap.Name = "Foreground";
sector.Add(tilemap);
SpawnPoint spawnpoint = new SpawnPoint();
spawnpoint.X = 96;
spawnpoint.Y = 96;
spawnpoint.Name = "main";
sector.Add(spawnpoint);
Camera camera = new Camera();
sector.Add(camera);
Background background = new Background();
background.Image = "images/background/BlueRock_Forest/blue-middle.jpg";
background.ImageTop = "images/background/BlueRock_Forest/blue-top.jpg";
background.ImageBottom = "images/background/BlueRock_Forest/blue-bottom.jpg";
sector.Add(background);
return sector;
}