本文整理汇总了C#中this.CreateEntity方法的典型用法代码示例。如果您正苦于以下问题:C# this.CreateEntity方法的具体用法?C# this.CreateEntity怎么用?C# this.CreateEntity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类this
的用法示例。
在下文中一共展示了this.CreateEntity方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateCollision
public static Entity CreateCollision(this Pool pool, Collision2D collision)
{
return pool.CreateEntity()
.AddCollision(collision)
.IsDestroying(true);
}
示例2: CreateDiscEntity
public static Entity CreateDiscEntity(this Pool pool, int x, int y, bool isBlack = false)
{
return pool.CreateEntity()
.AddPosition(x, y)
.AddDisc(isBlack)
.AddPrefab((GameObject)Resources.Load("Disc"));
}
示例3: CreateRandomUnit
public static Entity CreateRandomUnit(this Pool pool)
{
return pool.CreateEntity()
.AddUnit(_unitsNames[Random.Range(0, _unitsNames.Length)])
.AddTurnOrder(Random.Range(0, 100))
.AddResource(_units[Random.Range(0, _units.Length)]);
}
示例4: StartGameOver
public static Entity StartGameOver(this Pool pool)
{
var e = pool.CreateEntity()
.IsGameOver(true);
return e.AddCoroutine(LeaderboardHelper.GetCoroutine(pool, e));
}
示例5: CreateBlocker
public static Entity CreateBlocker(this Pool pool, int x, int y)
{
return pool.CreateEntity()
.IsGameBoardElement(true)
.AddPosition(x, y)
.AddResource(Res.Blocker);
}
示例6: CreateCamera
public static Entity CreateCamera(this EntityWorld world, string tag, GraphicsDevice device)
{
var entity = world.CreateEntity();
var camera = new Camera(device);
entity.AddComponent(camera);
entity.Tag = tag;
return entity;
}
示例7: CreateGun
public static Entity CreateGun(this Pool pool, GameObject view)
{
return pool.CreateEntity()
.AddGun(0.3f, 0)
.IsControllable(true)
.IsFireable(true)
.AddView(view);
}
示例8: CreateRedGem
public static Entity CreateRedGem(this Pool pool, int x, int y) {
return pool.CreateEntity()
.IsGameBoardElement(true)
.IsMovable(true)
.AddPosition(x, y)
.AddResource(Res.redGem)
.IsInteractive(true);
}
示例9: CreateRandomPiece
public static Entity CreateRandomPiece(this Pool pool, int x, int y) {
return pool.CreateEntity()
.IsGameBoardElement(true)
.AddPosition(x, y)
.IsMovable(true)
.IsInteractive(true)
.AddResource(_pieces[Random.Range(0, _pieces.Length)]);
}
示例10: CreateStoryOverlay
public static Entity CreateStoryOverlay(this EntityWorld world, string text, string className = "storyoverlay")
{
var entity = world.CreateEntity();
var element = new LibRocketNet.Element("div");
element.SetClass(className);
element.InnerRml = text;
entity.AddComponent(new GuiComponent(element));
return entity;
}
示例11: CloneEntity
/// Creates a new entity and adds copies of all
/// specified components to it.
/// If replaceExisting is true it will replace exisintg components.
public static Entity CloneEntity(this Context context,
Entity entity,
bool replaceExisting = false,
params int[] indices)
{
var target = context.CreateEntity();
entity.CopyTo(target, replaceExisting, indices);
return target;
}
示例12: CreateAsteroid
public static Entity CreateAsteroid(this Pool pool, float x, float y, AsteroidSize size)
{
return pool.CreateEntity()
.AddAsteroid(size)
.AddPosition(x, y)
.AddHitpoints(1)
.AddCollisionRadius(AsteroidData.Radii[size])
.IsWrappedAroundGameBounds(true)
.AddResource("Prefabs/" + AsteroidData.Resources[size]);
}
示例13: CreateGame
public static Entity CreateGame(this Pool pool, bool playing, int level, Bounds bounds)
{
return pool.CreateEntity()
.IsGame(true)
.AddBounds(bounds)
.AddLevel(level)
.AddLives(3)
.AddScore(0)
.IsPlaying(playing);
}
示例14: CreatePlayer
public static Entity CreatePlayer(this Pool pool, bool controllable)
{
return pool.CreateEntity()
.IsPlayer(true)
.AddPosition(0, 0)
.AddSpaceship(0.5f, 0.02f)
.AddCollisionRadius(1)
.IsControllable(controllable)
.IsWrappedAroundGameBounds(true)
.AddForce(new List<Vector2>(), 0)
.AddResource("Prefabs/Spaceship");
}
示例15: CreateGrid
public static Entity CreateGrid(this EntityWorld world, Vector2 gridSize, Color color)
{
var entity = world.CreateEntity();
var grid = new GridComponent
{
GridSize = gridSize,
GridColor = color
};
entity.AddComponent(grid);
return entity;
}