using System;
using UnityEngine;

// Token: 0x0200003E RID: 62
public class ParticleSunRotation : MonoBehaviour
{
	// Token: 0x06000801 RID: 2049 RVA: 0x000AFCD0 File Offset: 0x000ADED0
	private void OnEnable()
	{
		this.hasLight = false;
		if (!this.sunlight)
		{
			if (false)
			{
				GameObject gameObject = GameObject.Find("Sun");
				if (gameObject)
				{
					this.sunlight = gameObject.transform;
					this.hasLight = true;
				}
			}
			else
			{
				this.sunlight = Links.x.gameplay.sunlightAnimator.gameObject.transform;
			}
		}
		else
		{
			this.hasLight = true;
		}
		this.tr = base.transform;
	}

	// Token: 0x06000802 RID: 2050 RVA: 0x000AFD50 File Offset: 0x000ADF50
	private void Update()
	{
		if (this.hasLight)
		{
			this.tr.rotation = this.sunlight.rotation;
		}
	}

	// Token: 0x04000C71 RID: 3185
	[Header("Looks for light named 'Sun'")]
	public Transform sunlight;

	// Token: 0x04000C72 RID: 3186
	private bool hasLight;

	// Token: 0x04000C73 RID: 3187
	private Transform tr;
}
