Method SetParentSafe
SetParentSafe(Transform, Transform, bool, bool)
Change Tranform's parent, but ensures it is properly unpack if transform is part of a prefab (if editor)
Declaration
public static void SetParentSafe(this Transform transform, Transform parent, bool worldPositionStays = true, bool undo = true)
Parameters
Type | Name | Description |
---|---|---|
Transform | transform | the transform to modify |
Transform | parent | the new parent to set |
bool | worldPositionStays | should the world position remains as local postion |
bool | undo | should an undo operation be recorded |