コード例 #1
0
ファイル: Managers.cs プロジェクト: vvvv/VL.Stride
        public Entity Update(Spread <Entity> children)
        {
            // Quick change check
            if (children != this.children)
            {
                this.children = children;
            }
            else
            {
                return(entity);
            }

            // Synchronize our entity links
            var @array = children._array;

            for (int i = 0; i < array.Length; i++)
            {
                var link = links.ElementAtOrDefault(i);
                if (link == null)
                {
                    link = new EntityLink(entity);
                    links.Add(link);
                }
                link.Child = array[i];
            }
            for (int i = links.Count - 1; i >= array.Length; i--)
            {
                var link = links[i];
                link.Dispose();
                links.RemoveAt(i);
            }

            return(entity);
        }
コード例 #2
0
ファイル: Groups.cs プロジェクト: vvvv/VL.Stride
 public EntityGroup()
 {
     self  = new Entity();
     link1 = new EntityLink(self);
     link2 = new EntityLink(self);
 }