当前位置: 首页>>代码示例>>C#>>正文


C# this.CreateEntity方法代码示例

本文整理汇总了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);

    }
开发者ID:jyunfan2015,项目名称:Entitasteroids,代码行数:7,代码来源:PoolExtensions.cs

示例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"));
 }
开发者ID:zoeesilcock,项目名称:othello-unity,代码行数:7,代码来源:PoolExtension.cs

示例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)]);
 }
开发者ID:thebatoust,项目名称:EntitasTurnBasedGame,代码行数:7,代码来源:PoolExtensions.cs

示例4: StartGameOver

	public static Entity StartGameOver(this Pool pool)
	{
		var e = pool.CreateEntity()
			.IsGameOver(true);
		
		return e.AddCoroutine(LeaderboardHelper.GetCoroutine(pool, e));
	}
开发者ID:JuDelCo,项目名称:Shmup-AAA-plus,代码行数:7,代码来源:PoolExtensions.cs

示例5: CreateBlocker

 public static Entity CreateBlocker(this Pool pool, int x, int y)
 {
     return pool.CreateEntity()
         .IsGameBoardElement(true)
         .AddPosition(x, y)
         .AddResource(Res.Blocker);
 }
开发者ID:takaaptech,项目名称:Match-One,代码行数:7,代码来源:PoolExtensions.cs

示例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;
 }
开发者ID:raycrasher,项目名称:Fell-Sky,代码行数:8,代码来源:CameraEntityFactory.cs

示例7: CreateGun

 public static Entity CreateGun(this Pool pool, GameObject view)
 {
     return pool.CreateEntity()
         .AddGun(0.3f, 0)
         .IsControllable(true)
         .IsFireable(true)
         .AddView(view);
 }
开发者ID:jyunfan2015,项目名称:Entitasteroids,代码行数:8,代码来源:PoolExtensions.cs

示例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);
 }
开发者ID:mihail-georgiev,项目名称:Entitas-CSharp,代码行数:8,代码来源:ReadmeSnippets.cs

示例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)]);
 }
开发者ID:teresamadruga,项目名称:Match-One,代码行数:8,代码来源:PoolExtensions.cs

示例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;
 }
开发者ID:raycrasher,项目名称:Fell-Sky,代码行数:9,代码来源:StoryUtilities.cs

示例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;
 }
开发者ID:sschmid,项目名称:Entitas-CSharp,代码行数:12,代码来源:ContextExtension.cs

示例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]);
 }
开发者ID:jyunfan2015,项目名称:Entitasteroids,代码行数:10,代码来源:PoolExtensions.cs

示例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);
 }
开发者ID:jyunfan2015,项目名称:Entitasteroids,代码行数:10,代码来源:PoolExtensions.cs

示例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");
 }
开发者ID:jyunfan2015,项目名称:Entitasteroids,代码行数:12,代码来源:PoolExtensions.cs

示例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;
        }
开发者ID:raycrasher,项目名称:Fell-Sky,代码行数:12,代码来源:GridEntityFactory.cs


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