Ejemplo n.º 1
0
        public static void ConvertAndInjectOriginal(GameObject root)
        {
            var gameObjectWorld = GameObjectConversionUtility.CreateConversionWorld(World.Active, default(Hash128), 0);

            GameObjectEntity.AddToEntityManager(gameObjectWorld.EntityManager, root);

            GameObjectConversionUtility.Convert(gameObjectWorld, World.Active);

            var entity = GameObjectConversionUtility.GameObjectToConvertedEntity(gameObjectWorld, root);

            InjectOriginalComponents(World.Active.EntityManager, entity, root.transform);

            gameObjectWorld.Dispose();
        }
Ejemplo n.º 2
0
        public static void ConvertHierarchy(GameObject root)
        {
            var gameObjectWorld = GameObjectConversionUtility.CreateConversionWorld(World.Active, default(Hash128), 0);

            AddRecurse(gameObjectWorld.EntityManager, root.transform);

            GameObjectConversionUtility.Convert(gameObjectWorld, World.Active);

            InjectOriginalComponents(gameObjectWorld, World.Active.EntityManager, root.transform);

            GameObject.Destroy(root);

            gameObjectWorld.Dispose();
        }
        // ** CONVERSION **

        public World CreateConversionWorld()
        => GameObjectConversionUtility.CreateConversionWorld(this);