コード例 #1
0
    public void EntityExitSubworld(Entity entity, Subworld subworld)
    {
        subworld.RemoveEntity(entity);
        entity.MoveEntity(GenerationRandom.RNG.RandomPositionOnRadius(subworld.ExternalEntrancePos.AsVector3(), 1.5f), -1);
        entity.SetSubworld(null);
        //TODO - check that removing below code hasn't broken anything
        //This code should be run correctly in
        ///<see cref="EntityManager.MoveEntity(Entity, int, Vec2i)"/>
        ///

        /*
         * if (entity.GetLoadedEntity() != null)
         * {
         *  entity.SetFixed(true);
         *  EntityManager.Instance.UnloadEntity(entity.GetLoadedEntity(), false);
         *
         * }*/
    }