using System;
using UnityEngine;

// Token: 0x02000058 RID: 88
[ExecuteInEditMode]
public class Wings : MonoBehaviour
{
	// Token: 0x06000B14 RID: 2836 RVA: 0x000DCB58 File Offset: 0x000DAD58
	private void Start()
	{
		if (!this.r)
		{
			this.r = base.gameObject.GetComponent<SkinnedMeshRenderer>();
			this.startValue1 = Random.Range(0f, 100f);
			this.startValue2 = Random.Range(0f, 100f);
			this.startValue3 = Random.Range(0f, 100f);
			this.t1 = this.startValue1 / 100f;
			this.t2 = this.startValue2 / 100f;
			this.t3 = this.startValue3 / 100f;
			this.targetValue1 = 100f;
			this.targetValue2 = 100f;
			this.targetValue3 = 100f;
			if (Random.Range(0, 2) == 0)
			{
				this.targetValue1 = 0f;
				this.t1 = 1f - this.t1;
			}
			if (Random.Range(0, 2) == 0)
			{
				this.targetValue2 = 0f;
				this.t2 = 1f - this.t2;
			}
			if (Random.Range(0, 2) == 0)
			{
				this.targetValue3 = 0f;
				this.t3 = 1f - this.t3;
			}
		}
	}

	// Token: 0x06000B15 RID: 2837 RVA: 0x000DCC90 File Offset: 0x000DAE90
	private void Update()
	{
		float num = 0.5f;
		this.t1 += Time.deltaTime * num;
		this.value = Mathf.Lerp(this.startValue1, this.targetValue1, this.t1);
		this.r.SetBlendShapeWeight(0, this.value);
		if (this.value >= this.targetValue1 && this.targetValue1 > 50f)
		{
			this.targetValue1 = Random.Range(0f, 20f);
			this.startValue1 = this.value;
			this.t1 = 0f;
		}
		if (this.value <= this.targetValue1 && this.targetValue1 < 50f)
		{
			this.startValue1 = this.value;
			this.targetValue1 = Random.Range(70f, 100f);
			this.t1 = 0f;
		}
		this.t2 += Time.deltaTime * num;
		this.value = Mathf.Lerp(this.startValue2, this.targetValue2, this.t2);
		this.r.SetBlendShapeWeight(1, this.value);
		if (this.value >= this.targetValue2 && this.targetValue2 > 50f)
		{
			this.targetValue2 = Random.Range(0f, 20f);
			this.startValue2 = this.value;
			this.t2 = 0f;
		}
		if (this.value <= this.targetValue2 && this.targetValue2 < 50f)
		{
			this.startValue2 = this.value;
			this.targetValue2 = Random.Range(70f, 100f);
			this.t2 = 0f;
		}
		this.t3 += Time.deltaTime * num;
		this.value = Mathf.Lerp(this.startValue3, this.targetValue3, this.t3);
		this.r.SetBlendShapeWeight(2, this.value);
		if (this.value >= this.targetValue3 && this.targetValue3 > 50f)
		{
			this.targetValue3 = Random.Range(0f, 20f);
			this.startValue3 = this.value;
			this.t3 = 0f;
		}
		if (this.value <= this.targetValue2 && this.targetValue3 < 50f)
		{
			this.startValue3 = this.value;
			this.targetValue3 = Random.Range(70f, 100f);
			this.t3 = 0f;
		}
	}

	// Token: 0x04001001 RID: 4097
	private SkinnedMeshRenderer r;

	// Token: 0x04001002 RID: 4098
	private float startValue1;

	// Token: 0x04001003 RID: 4099
	private float startValue2;

	// Token: 0x04001004 RID: 4100
	private float startValue3;

	// Token: 0x04001005 RID: 4101
	private float t1;

	// Token: 0x04001006 RID: 4102
	private float t2;

	// Token: 0x04001007 RID: 4103
	private float t3;

	// Token: 0x04001008 RID: 4104
	private float value;

	// Token: 0x04001009 RID: 4105
	private float targetValue1;

	// Token: 0x0400100A RID: 4106
	private float targetValue2;

	// Token: 0x0400100B RID: 4107
	private float targetValue3;
}
