internal static World CreateConversionWorld(World dstEntityWorld, Hash128 sceneGUID, ConversionFlags conversionFlags) { m_CreateConversionWorld.Begin(); var gameObjectWorld = new World("GameObject World"); gameObjectWorld.CreateSystem <GameObjectConversionMappingSystem>(dstEntityWorld, sceneGUID, conversionFlags); AddConversionSystems(gameObjectWorld); m_CreateConversionWorld.End(); return(gameObjectWorld); }
internal static World CreateConversionWorld(GameObjectConversionSettings settings) { using (s_CreateConversionWorld.Auto()) { var gameObjectWorld = new World($"GameObject -> Entity Conversion '{settings.DebugConversionName}'", WorldFlags.Live | WorldFlags.Conversion | WorldFlags.Staging); gameObjectWorld.CreateSystem <GameObjectConversionMappingSystem>(settings); var systemTypes = settings.Systems ?? DefaultWorldInitialization.GetAllSystems(WorldSystemFilterFlags.GameObjectConversion); var includeExport = settings.GetType() != typeof(GameObjectConversionSettings); AddConversionSystems(gameObjectWorld, systemTypes.Concat(settings.ExtraSystems), includeExport); settings.ConversionWorldCreated?.Invoke(gameObjectWorld); return(gameObjectWorld); } }
internal static World CreateConversionWorld(GameObjectConversionSettings settings) { using (s_CreateConversionWorld.Auto()) { var gameObjectWorld = new World("GameObject World"); gameObjectWorld.CreateSystem <GameObjectConversionMappingSystem>(settings); var systemTypes = DefaultWorldInitialization.GetAllSystems(WorldSystemFilterFlags.GameObjectConversion); systemTypes.AddRange(settings.ExtraSystems); var includeExport = settings.GetType() != typeof(GameObjectConversionSettings); AddConversionSystems(gameObjectWorld, systemTypes, includeExport); settings.ConversionWorldCreated?.Invoke(gameObjectWorld); return(gameObjectWorld); } }
public void Initialize(Unity.Entities.World space) { sinRotatorSystem = space.CreateSystem <SinRotatorSystem>(); AddSystemToUpdateList(sinRotatorSystem); animatorSystem = space.GetOrCreateSystem <Zoxel.Animations.AnimatorSystem>(); animatorEndSystem = space.GetOrCreateSystem <Zoxel.Animations.AnimatorEndSystem>(); shrinkSystem2 = space.GetOrCreateSystem <ShrinkSystem2>(); shrinkSystem3 = space.GetOrCreateSystem <ShrinkSystem3>(); lerpPositionSystem = space.GetOrCreateSystem <LerpPositionSystem>(); lerpScaleSystem = space.GetOrCreateSystem <LerpScaleSystem>(); lerpPositionEntitySystem = space.GetOrCreateSystem <LerpPositionEntitySystem>(); doomedToDieSystem = space.GetOrCreateSystem <DoomedToDieSystem>(); AddSystemToUpdateList(animatorSystem); AddSystemToUpdateList(animatorEndSystem); AddSystemToUpdateList(shrinkSystem2); AddSystemToUpdateList(shrinkSystem3); AddSystemToUpdateList(lerpPositionSystem); AddSystemToUpdateList(lerpScaleSystem); AddSystemToUpdateList(lerpPositionEntitySystem); AddSystemToUpdateList(doomedToDieSystem); SetLinks(); }
internal static World CreateConversionWorld(GameObjectConversionSettings settings) { using (s_CreateConversionWorld.Auto()) { var gameObjectWorld = new World($"GameObject -> Entity Conversion '{settings.DebugConversionName}'"); gameObjectWorld.CreateSystem <GameObjectConversionMappingSystem>(settings); var systemTypes = DefaultWorldInitialization.GetAllSystems(WorldSystemFilterFlags.GameObjectConversion); if (settings.ExtraSystems.Length > 0) { var systems = new List <Type>(systemTypes.Count + settings.ExtraSystems.Length); systems.AddRange(systemTypes); systems.AddRange(settings.ExtraSystems); systemTypes = systems; } var includeExport = settings.GetType() != typeof(GameObjectConversionSettings); AddConversionSystems(gameObjectWorld, systemTypes, includeExport); settings.ConversionWorldCreated?.Invoke(gameObjectWorld); return(gameObjectWorld); } }