Nez.Portable/ECS/Scene.cs
/// <summary>
/// adds an Entity to the Scene's Entities list
/// </summary>
/// <param name="entity">The Entity to add</param>
adds an Entity to the Scene's Entities list
adds an Entity to the Scene ' s Entities list
public Entity addEntity(Entity entity)
        {
            Assert.isFalse(
                entities.contains(entity),
                "You are attempting to add the same entity to a scene twice: {0}",
                entity);
            entities.add(entity);
            entity.scene = this;
            for (var i = 0; i < entity.transform.childCount; i++)
                addEntity(entity.transform.getChild(i).entity);
            return entity;
        }
public Entity addEntity ( Entity entity ) { Assert . isFalse ( entities . contains ( entity ) , " " , entity ) ; entities . add ( entity ) ; entity . scene = this ; for ( var i = 0 ; i < entity . transform . childCount ; i ++ ) addEntity ( entity . transform . getChild ( i ) . entity ) ; return entity ; }
adds an Entity to the Scene's Entities list
adds an Entity to the Scene ' s Entities list
entity
Entity
The Entity to add
The Entity to add