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

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