r2mods/ilspy_dump/ror2_csproj/RoR2/FollowerItemDisplayComponen...

35 lines
613 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using UnityEngine;
namespace RoR2;
public class FollowerItemDisplayComponent : MonoBehaviour
{
public Transform target;
public Vector3 localPosition;
public Quaternion localRotation;
public Vector3 localScale;
private new Transform transform;
private void Awake()
{
transform = base.transform;
}
private void LateUpdate()
{
if (!target)
{
Object.Destroy(base.gameObject);
return;
}
Quaternion rotation = target.rotation;
transform.position = target.position + rotation * localPosition;
transform.rotation = rotation * localRotation;
transform.localScale = localScale;
}
}