28 if (!_v::IsUnityPtrValid(p_This))
31 p_This->set_layer(p_Layer);
33 auto l_ChildCount = p_This->get_transform()->get_childCount();
34 for (
auto l_I = 0; l_I < l_ChildCount; ++l_I)
36 auto l_Child = p_This->get_transform()->GetChild(l_I)->get_gameObject();
37 if (_v::IsUnityPtrValid(l_Child))
44 inline static _u::GameObject*
FindCommonRoot(_u::GameObject* p_Left, _u::GameObject* p_Right)
46 if (!_v::IsUnityPtrValid(p_Left) || !_v::IsUnityPtrValid(p_Right))
49 auto l_LeftTransform = p_Left->get_transform();
50 while (_v::IsUnityPtrValid(l_LeftTransform))
52 auto l_RightTransform = p_Right->get_transform();
53 while (_v::IsUnityPtrValid(l_RightTransform))
55 if (l_LeftTransform == l_RightTransform)
56 return l_LeftTransform->get_gameObject();
58 l_RightTransform = l_RightTransform->get_parent();
61 l_LeftTransform = l_LeftTransform->get_parent();