22 lines
442 B
C#
22 lines
442 B
C#
using UnityEngine;
|
|
|
|
public class ResetChildLocalRotation : MonoBehaviour
|
|
{
|
|
[SerializeField] private Transform target;
|
|
|
|
private Quaternion initialLocalRotation;
|
|
|
|
private void Awake()
|
|
{
|
|
if (target != null)
|
|
initialLocalRotation = target.localRotation;
|
|
}
|
|
|
|
public void ResetRotation()
|
|
{
|
|
if (target == null)
|
|
return;
|
|
|
|
target.localRotation = initialLocalRotation;
|
|
}
|
|
} |