using UnityEngine;

namespace Wizard;

internal class TransformBackup
{
	public Transform backup_parent { get; private set; }

	public Vector3 backup_pos { get; private set; }

	public Vector3 backup_scale { get; private set; }

	public int backup_layer { get; private set; }

	public void Save(Transform trans)
	{
		backup_parent = trans.parent;
		backup_pos = trans.localPosition;
		backup_scale = trans.localScale;
		backup_layer = trans.gameObject.layer;
	}

	public void Restore(Transform trans)
	{
		trans.parent = backup_parent;
		trans.localPosition = backup_pos;
		trans.localScale = backup_scale;
		trans.gameObject.layer = backup_layer;
	}
}
