22 lines
457 B
C#
22 lines
457 B
C#
|
using System;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
public class UpdateTransform : MonoBehaviour
|
|||
|
{
|
|||
|
public Transform target;
|
|||
|
|
|||
|
public void SetData(Transform _target)
|
|||
|
{
|
|||
|
target = _target;
|
|||
|
}
|
|||
|
|
|||
|
private void Update()
|
|||
|
{
|
|||
|
if (target != null)
|
|||
|
{
|
|||
|
transform.localPosition = target.localPosition;
|
|||
|
transform.localRotation = target.localRotation;
|
|||
|
transform.localScale = target.localScale;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|