コード例 #1
0
ファイル: GameObject.cs プロジェクト: GooDer/descent
        public void AddChild(GameObject child, bool setRelativePosition = false)
        {
            child.Parent = this;
            AddChild(child);

            if (setRelativePosition)
            {
                child.PositionRelatedTo(this);
            }
        }
コード例 #2
0
ファイル: GameObject.cs プロジェクト: GooDer/descent
 public virtual void PositionRelatedTo(GameObject gameObject)
 {
     Position = new Vector2(Position.X + gameObject.Position.X, Position.Y + gameObject.Position.Y);
 }