Exemple #1
0
        public void InstantiateView(ViewId viewId)
        {
            var world       = Worlds.current;
            var viewsModule = world.GetModule <ME.ECS.Views.ViewsModule>();

            viewsModule.InstantiateView(viewId, in this);
        }
Exemple #2
0
 public static void ReplaceView(this Entity entity, ViewId viewId)
 {
     if (entity.Has <ViewComponent>() == true)
     {
         ref var view = ref entity.Get <ViewComponent>();
         if (view.viewInfo.prefabSourceId != viewId)
         {
             view.viewInfo = new ViewInfo(entity, viewId, Worlds.currentWorld.GetStateTick());
         }
     }
Exemple #3
0
        public void InstantiateView <TEntity>(ViewId prefab, Entity entity) where TEntity : struct, IEntity
        {
            var viewsModule = this.GetModule <ViewsModule <TState, TEntity> >();

            viewsModule.InstantiateView(prefab, entity);
        }
Exemple #4
0
 public void InstantiateViewShared(ViewId prefab)
 {
     this.InstantiateView <SharedEntity>(prefab, this.sharedEntity);
 }
Exemple #5
0
        public void InstantiateView(ViewId prefab, Entity entity)
        {
            var viewsModule = this.GetModule <ViewsModule>();

            viewsModule.InstantiateView(prefab, entity);
        }
Exemple #6
0
 public static void InstantiateView(this Entity entity, ViewId viewId)
 {
     Worlds.currentWorld.InstantiateView(viewId, entity);
 }