예제 #1
0
 internal void CreateNewSceneGlobalEntity()
 {
     if (!EntityManager.Exists(sceneGlobalEntity))
     {
         sceneGlobalEntity = new ManagedEntity(EntityManager.CreateEntity(), EntityManager);
         sceneGlobalEntity.AddComponentData(new SceneGlobalTag());
     }
 }
예제 #2
0
        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
            }
        }
예제 #3
0
        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>();
        }
예제 #4
0
        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>();
        }