27 lines
585 B
C#
27 lines
585 B
C#
|
using System;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
namespace HK
|
|||
|
{
|
|||
|
public class UpdateTransform : MonoBehaviour
|
|||
|
{
|
|||
|
private Transform target;
|
|||
|
|
|||
|
private void Awake()
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
public void SetData(Transform target)
|
|||
|
{
|
|||
|
this.target = target;
|
|||
|
}
|
|||
|
|
|||
|
private void Update()
|
|||
|
{
|
|||
|
if (transform == null || target == null) return;
|
|||
|
transform.localPosition = target.localPosition;
|
|||
|
transform.localScale = target.localScale;
|
|||
|
transform.localRotation = target.localRotation;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|