コード例 #1
0
 internal void CreateNewSceneGlobalEntity()
 {
     if (!EntityManager.Exists(sceneGlobalEntity))
     {
         sceneGlobalEntity = new ManagedEntity(EntityManager.CreateEntity(), EntityManager);
         sceneGlobalEntity.AddComponentData(new SceneGlobalTag());
     }
 }
コード例 #2
0
ファイル: LatiosWorld.cs プロジェクト: KiJou/lsss-wip
        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
ファイル: LatiosWorld.cs プロジェクト: KiJou/lsss-wip
        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>();
        }