Esempio n. 1
0
        public EntityWrapper AddElementToBuffer <T>(T element) where T : struct, IBufferElementData
        {
            var buffer = EntityManagerWrapper.AddBuffer <T>(Entity);

            buffer.Add(element);
            return(this);
        }
Esempio n. 2
0
        public EntityWrapper AddElementsToBuffer <T>(params T[] elements) where T : struct, IBufferElementData
        {
            var buffer = EntityManagerWrapper.AddBuffer <T>(Entity);

            foreach (var element in elements)
            {
                buffer.Add(element);
            }
            return(this);
        }
Esempio n. 3
0
        public EntityWrapper AddBuffer <T>(int repeat) where T : struct, IBufferElementData
        {
            var buffer = EntityManagerWrapper.AddBuffer <T>(Entity);

            for (var i = 0; i < repeat; i++)
            {
                buffer.Add(new T());
            }

            return(this);
        }
Esempio n. 4
0
 public DynamicBuffer <T> AddOrCreateBuffer <T>() where T : struct, IBufferElementData
 {
     return(EntityManagerWrapper.HasComponent <T>(Entity) ? EntityManagerWrapper.GetBuffer <T>(Entity) : EntityManagerWrapper.AddBuffer <T>(Entity));
 }
Esempio n. 5
0
 public EntityWrapper AddBuffer <T>() where T : struct, IBufferElementData
 {
     EntityManagerWrapper.AddBuffer <T>(Entity);
     return(this);
 }
Esempio n. 6
0
 public DynamicBuffer <T> AddBufferAndReturn <T>() where T : struct, IBufferElementData
 {
     return(EntityManagerWrapper.AddBuffer <T>(Entity));
 }