internal void CreateNewSceneGlobalEntity() { if (!EntityManager.Exists(sceneGlobalEntity)) { sceneGlobalEntity = new ManagedEntity(EntityManager.CreateEntity(), EntityManager); sceneGlobalEntity.AddComponentData(new SceneGlobalTag()); } }
internal void CreateNewSceneGlobalEntity() { if (!EntityManager.Exists(sceneGlobalEntity) || !sceneGlobalEntity.HasComponentData <SceneGlobalTag>()) { sceneGlobalEntity = new ManagedEntity(EntityManager.CreateEntity(), EntityManager); sceneGlobalEntity.AddComponentData(new SceneGlobalTag()); #if UNITY_EDITOR EntityManager.SetName(sceneGlobalEntity, "Scene Global Entity"); #endif } }
public LatiosWorld(string name) : base(name) { BootstrapTools.PopulateTypeManagerWithGenerics(typeof(ManagedComponentTag <>), typeof(IComponent)); BootstrapTools.PopulateTypeManagerWithGenerics(typeof(ManagedComponentSystemStateTag <>), typeof(IComponent)); BootstrapTools.PopulateTypeManagerWithGenerics(typeof(CollectionComponentTag <>), typeof(ICollectionComponent)); BootstrapTools.PopulateTypeManagerWithGenerics(typeof(CollectionComponentSystemStateTag <>), typeof(ICollectionComponent)); worldGlobalEntity = new ManagedEntity(EntityManager.CreateEntity(), EntityManager); sceneGlobalEntity = new ManagedEntity(EntityManager.CreateEntity(), EntityManager); worldGlobalEntity.AddComponentData(new WorldGlobalTag()); sceneGlobalEntity.AddComponentData(new SceneGlobalTag()); m_initializationSystemGroup = GetOrCreateSystem <MyInitializationSystemGroup>(); m_simulationSystemGroup = GetOrCreateSystem <SimulationSystemGroup>(); m_presentationSystemGroup = GetOrCreateSystem <PresentationSystemGroup>(); }
public LatiosWorld(string name) : base(name) { //BootstrapTools.PopulateTypeManagerWithGenerics(typeof(ManagedComponentTag<>), typeof(IManagedComponent)); BootstrapTools.PopulateTypeManagerWithGenerics(typeof(ManagedComponentSystemStateTag <>), typeof(IManagedComponent)); //BootstrapTools.PopulateTypeManagerWithGenerics(typeof(CollectionComponentTag<>), typeof(ICollectionComponent)); BootstrapTools.PopulateTypeManagerWithGenerics(typeof(CollectionComponentSystemStateTag <>), typeof(ICollectionComponent)); worldGlobalEntity = new ManagedEntity(EntityManager.CreateEntity(), EntityManager); sceneGlobalEntity = new ManagedEntity(EntityManager.CreateEntity(), EntityManager); worldGlobalEntity.AddComponentData(new WorldGlobalTag()); sceneGlobalEntity.AddComponentData(new SceneGlobalTag()); #if UNITY_EDITOR EntityManager.SetName(worldGlobalEntity, "World Global Entity"); EntityManager.SetName(sceneGlobalEntity, "Scene Global Entity"); #endif m_initializationSystemGroup = GetOrCreateSystem <LatiosWorldInitializationSystemGroup>(); m_simulationSystemGroup = GetOrCreateSystem <LatiosSimulationSystemGroup>(); m_presentationSystemGroup = GetOrCreateSystem <LatiosPresentationSystemGroup>(); }