Extract to methods GameObject Parent

Before setting the value of the parent for the GameObject, it checks if
there is any closed parent loops(first method), then it removes the old
parent from the child. Afterwards, if adjust the GameObjects to the
proper scene(third method). It then adds the newly created Parent to the
child(fourth method) before notifying that the parent has changed.Before
setting the value of the parent for the GameObject, it checks if there
is any closed parent loops(first method), then it removes the old parent
from the child. Afterwards, if adjust the GameObjects to the proper
scene(third method). It then adds the newly created Parent to the
child(fourth method) before notifying that the parent has changed.