public void Process(EntityManagerWrapper wrapper, EntityVariableMap variables, Entity entity)
 {
     wrapper.AddComponentData(entity, new Parent {
         Value = m_parentEntity
     });
     wrapper.AddComponentData(entity, new LocalToParent());
 }
        protected override void OnPreBuild(EntityManagerWrapper wrapper)
        {
            var networkEntityId = ServerManager.Instance.NextNetworkEntityId;

            AddComponentData(new NetworkEntity {
                networkEntityId = networkEntityId
            });
        }
        public void Process(EntityManagerWrapper wrapper, EntityVariableMap variables, Entity entity)
        {
            var buffer = wrapper.AddBuffer <T>(entity);

            foreach (var item in m_elements)
            {
                buffer.Add(item);
            }
        }
        protected override void OnPreBuild(EntityManagerWrapper wrapper)
        {
            base.OnPreBuild(wrapper);

            var playerPrefab     = Resources.Load <GameObject>("Prefabs/PlayerAvatar");
            var playerGameObject = GameObjectEntityManager.Instance.CreateFromPrefab(playerPrefab);

            AddComponentData(new ManagedGameObject {
                instanceId = playerGameObject.GetInstanceID()
            });
        }
Exemple #5
0
        public override Entity Build(EntityManagerWrapper wrapper)
        {
            foreach (var connection in connections)
            {
                AddComponentData(new SendRpcCommandRequestComponent {
                    TargetConnection = connection
                });
                base.Build(wrapper);
            }

            return(Entity.Null);
        }
 public void Process(EntityManagerWrapper wrapper, EntityVariableMap variables, ref EntityBuilderData data)
 {
     if (m_callback != null)
     {
         m_callback?.Invoke(wrapper);
     }
     else
     {
         var buffer = wrapper.AddBuffer <T>(data.entity);
         if (m_elements != null)
         {
             foreach (var element in m_elements)
             {
                 buffer.Add(element);
             }
         }
     }
 }
Exemple #7
0
        public override Entity Build(EntityManagerWrapper wrapper)
        {
            if (!isBroadcast)
            {
                return(base.Build(wrapper));
            }

            var connections = ServerManager.Instance.AllConnections;

            foreach (var connection in connections)
            {
                var entity = base.Build(wrapper);
                wrapper.AddComponentData(entity, new SendRpcCommandRequestComponent {
                    TargetConnection = connection
                });
            }

            return(Entity.Null);
        }
 public Entity Create(EntityManagerWrapper wrapper, EntityVariableMap variables)
 {
     return(wrapper.CreateEntity(EntityArchetypeManager.Instance.GetOrCreateArchetype <T>()));
 }
 public void Process(EntityManagerWrapper wrapper, EntityVariableMap variables, ref EntityBuilderData data)
 {
     wrapper.SetComponentData(data.entity, new Translation {
         Value = m_position
     });
 }
 public void Process(EntityManagerWrapper wrapper, EntityVariableMap variables, Entity entity)
 {
     wrapper.AddComponentData(entity, new Scale {
         Value = m_scale
     });
 }
Exemple #11
0
 public void Process(EntityManagerWrapper wrapper, EntityVariableMap variables, ref EntityBuilderData data)
 {
     data.entity = wrapper.CreateEntity(GetEntityArchetype(wrapper));
     wrapper.SetName(data.entity, typeof(T).Name + " " + data.entity.Index);
 }
Exemple #12
0
 private static EntityArchetype GetEntityArchetype(EntityManagerWrapper wrapper)
 {
     return(EntityArchetypeManager.Instance.GetOrCreateArchetype <T>(wrapper));
 }
Exemple #13
0
 public void Process(EntityManagerWrapper wrapper, EntityVariableMap variables, Entity entity)
 {
     wrapper.AddComponent <T>(entity);
 }
 public void Process(EntityManagerWrapper wrapper, EntityVariableMap variables, Entity entity)
 {
     wrapper.SetComponentData(entity, new Translation {
         Value = m_position
     });
 }
 public void Process(EntityManagerWrapper wrapper, EntityVariableMap variables, ref EntityBuilderData data)
 {
     data.entity = wrapper.CreateEntity();
 }
 public void Process(EntityManagerWrapper wrapper, EntityVariableMap variables, ref EntityBuilderData data)
 {
     wrapper.AddSharedComponentData(data.entity, m_componentData);
 }
 public Entity Create(EntityManagerWrapper wrapper, EntityVariableMap variables)
 {
     return(wrapper.CreateEntity());
 }
Exemple #18
0
 public Entity Create(EntityManagerWrapper wrapper, EntityVariableMap variables)
 {
     return(wrapper.Instantiate(m_prefabEntity));
 }
Exemple #19
0
 public void Process(EntityManagerWrapper wrapper, EntityVariableMap variables, Entity entity)
 {
     wrapper.SetComponentData(entity, m_componentData);
 }
        public void Process(EntityManagerWrapper wrapper, EntityVariableMap variables, Entity entity)
        {
#if UNITY_EDITOR
            wrapper.SetName(entity, m_name);
#endif
        }
Exemple #21
0
 public void Process(EntityManagerWrapper wrapper, EntityVariableMap variables, Entity entity)
 {
     wrapper.AddComponentObject(entity, m_componentObject);
 }