Beispiel #1
0
        public void AddChild(GameObject child, bool setRelativePosition = false)
        {
            child.Parent = this;
            AddChild(child);

            if (setRelativePosition)
            {
                child.PositionRelatedTo(this);
            }
        }
Beispiel #2
0
 public virtual void PositionRelatedTo(GameObject gameObject)
 {
     Position = new Vector2(Position.X + gameObject.Position.X, Position.Y + gameObject.Position.Y);
 }