Пример #1
0
 public static void AddEntity(Entity entity)
 {
     if (Count < EntitiesCollection.Count)
     {
         EntitiesCollection[Count++] = entity;
     }
     else
     {
         EntitiesCollection.Add(entity);
         Count = EntitiesCollection.Count;
     }
     RepresentationManager.OnEvent(EventName.EntityEnabled, entity);
 }
Пример #2
0
        public static void Update(float FixedFrequencyTime)
        {
            var j = 0;

            for (int i = 0; i < Count; i++)
            {
                var entity = EntitiesCollection[i];
                if (entity.Despawn)
                {
                    RepresentationManager.OnEvent(EventName.EntityDisabled, entity);
                }
                else
                {
                    entity.PreUpdate(FixedFrequencyTime);
                    entity.OnUpdate(FixedFrequencyTime);
                    EntitiesCollection[j++] = entity;
                }
            }
            Count = j;
        }
Пример #3
0
 private void OnEnable()
 {
     Despawn = false;
     RepresentationManager.AddRepresentation(this);
 }
Пример #4
0
 void Update()
 {
     RepresentationManager.Update(Time.time);
 }