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); }
private void SetParent(BaseGameObject p = null) { Parent = p; //_parent?.RemoveChild(this); //p?.AddChild(this); //if (HasParent) //{ // UnMapParentTransform(); //} //_parent = p; //if (SnapToParent && HasParent) //{ // MapParentTransform(); //} }
protected void Attach(BaseGameObject baseGameObject, bool center = false) { Attach(baseGameObject, center, 0, 0); }
private void AddChild(BaseGameObject baseGameObject) { ChildList.Add(baseGameObject); }
private void RemoveChild(BaseGameObject baseGameObject) { ChildList.Remove(baseGameObject); }