Beispiel #1
0
        private void Attach(BaseGameObject baseGameObject, bool center, float offsetX, float offsetY)
        {
            baseGameObject.UnAttach();
            baseGameObject.SetParent(this);
            AddChild(baseGameObject);

            if (center)
            {
                baseGameObject.GlobalTransform = GlobalTransform;
            }

            baseGameObject.LocalTransform.SetPosition(offsetX, offsetY);
        }
Beispiel #2
0
        private void SetParent(BaseGameObject p = null)
        {
            Parent = p;

            //_parent?.RemoveChild(this);
            //p?.AddChild(this);

            //if (HasParent)
            //{
            //    UnMapParentTransform();
            //}

            //_parent = p;

            //if (SnapToParent && HasParent)
            //{
            //    MapParentTransform();
            //}
        }
Beispiel #3
0
 protected void Attach(BaseGameObject baseGameObject, bool center = false)
 {
     Attach(baseGameObject, center, 0, 0);
 }
Beispiel #4
0
 private void AddChild(BaseGameObject baseGameObject)
 {
     ChildList.Add(baseGameObject);
 }
Beispiel #5
0
 private void RemoveChild(BaseGameObject baseGameObject)
 {
     ChildList.Remove(baseGameObject);
 }