コード例 #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);
        }
コード例 #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();
            //}
        }
コード例 #3
0
 protected void Attach(BaseGameObject baseGameObject, bool center = false)
 {
     Attach(baseGameObject, center, 0, 0);
 }
コード例 #4
0
 private void AddChild(BaseGameObject baseGameObject)
 {
     ChildList.Add(baseGameObject);
 }
コード例 #5
0
 private void RemoveChild(BaseGameObject baseGameObject)
 {
     ChildList.Remove(baseGameObject);
 }