Children
Introduction
Code Example
using FlatRedBall.Graphics;// we'll use PositionedObjects here, but could be anything - Sprite, Text, or custom Entity class
PositionedObject first = new PositionedObject();
PositionedObject second = new PositionedObject();
int countBefore = first.Children.Count;
second.AttachTo(first, false);
int countAfter = first.Children.Count;
second.Detach();
int finalCount = first.Children.Count;
string displayString =
string.Format("Before:{0}\nAfter:{1}\nFinal:{2}", countBefore, countAfter, finalCount);
TextManager.AddText(displayString);
Last updated
Was this helpful?