Пример #1
0
	/// <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);
	}
Пример #2
0
	/// <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);
	}
Пример #3
0
	/// <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);
	}