/// <summary> /// Clears rotation of this transform without affecting its children. /// </summary> /// <param name='root'> /// Root. /// </param> public static void ClearLocalRotation(this Transform root) { var children = root.GetChildren(); root.DetachChildren(); root.localRotation = Quaternion.identity; root.AttachChildren(children); }
/// <summary> /// Clears scale of this transform without affecting children. /// </summary> /// <param name='root'> /// Root. /// </param> public static void ClearLocalScale(this Transform root) { var children = root.GetChildren(); root.DetachChildren(); root.localScale = Vector3.one; root.AttachChildren(children); }
/// <summary> /// Clears the position of this transform without affecting its children. /// </summary> /// <param name='root'> /// Root. /// </param> public static void ClearLocalPosition(this Transform root) { var children = root.GetChildren(); root.DetachChildren(); root.localPosition = Vector3.zero; root.AttachChildren(children); }