You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.3 KiB

using System;
using UnityEngine;
namespace FX
{
// Token: 0x02000746 RID: 1862
public class FX_LensFlare_Move : MonoBehaviour
{
// Token: 0x06002FF4 RID: 12276 RVA: 0x00100BE0 File Offset: 0x00100BE0
private void Start()
{
if (this._centerPosition == null)
{
this._centerPosition = base.transform;
}
this.OriginalScale = new Vector3(1f / base.transform.lossyScale.x, 1f / base.transform.lossyScale.y, 1f / base.transform.lossyScale.z);
}
// Token: 0x06002FF5 RID: 12277 RVA: 0x00100C60 File Offset: 0x00100C60
private void Update()
{
float x = this._targetPosition.position.x - this._centerPosition.position.x;
float y = this._targetPosition.position.y - this._centerPosition.position.y;
float num = Mathf.Atan2(y, x) * 57.29578f;
base.transform.localEulerAngles = new Vector3(0f, 0f, num - 90f);
float num2 = Vector3.Distance(this._centerPosition.position, this._targetPosition.position);
base.transform.localScale = new Vector3(num2 * this.OriginalScale.x, num2 * this.OriginalScale.y, num2 * this.OriginalScale.z);
}
// Token: 0x04005587 RID: 21895
[SerializeField]
private Transform _targetPosition;
// Token: 0x04005588 RID: 21896
private Transform _centerPosition;
// Token: 0x04005589 RID: 21897
private Vector3 OriginalScale;
}
}