using System;
using System.Collections.Generic;
using Cpp2IlInjected;
using UnityEngine;

namespace DigitalRuby.LightningBolt
{
	// Token: 0x0200058E RID: 1422
	[Token(Token = "0x200058E")]
	[RequireComponent(typeof(LineRenderer))]
	public class LightningBoltScript : MonoBehaviour
	{
		// Token: 0x06002E8D RID: 11917 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002E8D")]
		[Address(RVA = "0x3F4F90", Offset = "0x3F3D90", VA = "0x1803F4F90")]
		private void GetPerpendicularVector(ref Vector3 directionNormalized, out Vector3 side)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002E8E RID: 11918 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002E8E")]
		[Address(RVA = "0x3F4A20", Offset = "0x3F3820", VA = "0x1803F4A20")]
		private void GenerateLightningBolt(Vector3 start, Vector3 end, int generation, int totalGenerations, float offsetAmount)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002E8F RID: 11919 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002E8F")]
		[Address(RVA = "0x3F50E0", Offset = "0x3F3EE0", VA = "0x1803F50E0")]
		public void RandomVector(ref Vector3 start, ref Vector3 end, float offsetAmount, out Vector3 result)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002E90 RID: 11920 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002E90")]
		[Address(RVA = "0x3F54B0", Offset = "0x3F42B0", VA = "0x1803F54B0")]
		private void SelectOffsetFromAnimationMode()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002E91 RID: 11921 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002E91")]
		[Address(RVA = "0x3F5BB0", Offset = "0x3F49B0", VA = "0x1803F5BB0")]
		private void UpdateLineRenderer()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002E92 RID: 11922 RVA: 0x000633D0 File Offset: 0x000615D0
		[Token(Token = "0x6002E92")]
		[Address(RVA = "0x3F56D0", Offset = "0x3F44D0", VA = "0x1803F56D0")]
		private void Start()
		{
			Camera main = Camera.main;
			int num = 0;
			if (!(main != num))
			{
			}
			bool flag = Camera.main.orthographic;
			this.orthographic = flag;
			LineRenderer component = base.GetComponent<LineRenderer>();
			this.lineRenderer = component;
			LineRenderer lineRenderer = this.lineRenderer;
			int num2 = 0;
			lineRenderer.SetVertexCount(num2);
			this.UpdateFromMaterialChange();
		}

		// Token: 0x06002E93 RID: 11923 RVA: 0x00063438 File Offset: 0x00061638
		[Token(Token = "0x6002E93")]
		[Address(RVA = "0x3F5DD0", Offset = "0x3F4BD0", VA = "0x1803F5DD0")]
		private void Update()
		{
			Camera main = Camera.main;
			int num = 0;
			if (!(main != num))
			{
			}
			bool flag = Camera.main.orthographic;
			this.orthographic = flag;
			if (!this.ManualMode)
			{
				this.Trigger();
			}
			LineRenderer lineRenderer = this.lineRenderer;
			float duration = this.Duration;
			this.timer = duration;
			int num2 = 0;
			lineRenderer.SetVertexCount(num2);
			float num3 = this.timer;
			float deltaTime = Time.deltaTime;
			this.timer = num3;
		}

		// Token: 0x06002E94 RID: 11924 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002E94")]
		[Address(RVA = "0x3F57B0", Offset = "0x3F45B0", VA = "0x1803F57B0")]
		public void Trigger()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002E95 RID: 11925 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6002E95")]
		[Address(RVA = "0x3F5A30", Offset = "0x3F4830", VA = "0x1803F5A30")]
		public void UpdateFromMaterialChange()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06002E96 RID: 11926 RVA: 0x000634C8 File Offset: 0x000616C8
		[Token(Token = "0x6002E96")]
		[Address(RVA = "0x3F5EC0", Offset = "0x3F4CC0", VA = "0x1803F5EC0")]
		public LightningBoltScript()
		{
			System.Random random = new System.Random();
			this.RandomGenerator = random;
			List<KeyValuePair<Vector3, Vector3>> list = new List();
			this.segments = list;
			this.animationPingPongDirection = (int)((ulong)1L);
			base..ctor();
		}

		// Token: 0x04003764 RID: 14180
		[FieldOffset(Offset = "0x18")]
		[Token(Token = "0x4003764")]
		[Tooltip("The game object where the lightning will emit from. If null, StartPosition is used.")]
		public GameObject StartObject;

		// Token: 0x04003765 RID: 14181
		[FieldOffset(Offset = "0x20")]
		[Token(Token = "0x4003765")]
		[Tooltip("The start position where the lightning will emit from. This is in world space if StartObject is null, otherwise this is offset from StartObject position.")]
		public Vector3 StartPosition;

		// Token: 0x04003766 RID: 14182
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x4003766")]
		[Tooltip("The game object where the lightning will end at. If null, EndPosition is used.")]
		public GameObject EndObject;

		// Token: 0x04003767 RID: 14183
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x4003767")]
		[Tooltip("The end position where the lightning will end at. This is in world space if EndObject is null, otherwise this is offset from EndObject position.")]
		public Vector3 EndPosition;

		// Token: 0x04003768 RID: 14184
		[FieldOffset(Offset = "0x44")]
		[Token(Token = "0x4003768")]
		[Tooltip("How manu generations? Higher numbers create more line segments.")]
		[Range(0f, 8f)]
		public int Generations = (int)((ulong)6L);

		// Token: 0x04003769 RID: 14185
		[FieldOffset(Offset = "0x48")]
		[Token(Token = "0x4003769")]
		[Tooltip("How long each bolt should last before creating a new bolt. In ManualMode, the bolt will simply disappear after this amount of seconds.")]
		[Range(0.01f, 1f)]
		public float Duration = 0.05f;

		// Token: 0x0400376A RID: 14186
		[FieldOffset(Offset = "0x4C")]
		[Token(Token = "0x400376A")]
		private float timer;

		// Token: 0x0400376B RID: 14187
		[FieldOffset(Offset = "0x50")]
		[Token(Token = "0x400376B")]
		[Range(0f, 1f)]
		[Tooltip("How chaotic should the lightning be? (0-1)")]
		public float ChaosFactor = 0.15f;

		// Token: 0x0400376C RID: 14188
		[FieldOffset(Offset = "0x54")]
		[Token(Token = "0x400376C")]
		[Tooltip("In manual mode, the trigger method must be called to create a bolt")]
		public bool ManualMode;

		// Token: 0x0400376D RID: 14189
		[FieldOffset(Offset = "0x58")]
		[Token(Token = "0x400376D")]
		[Range(1f, 64f)]
		[Tooltip("The number of rows in the texture. Used for animation.")]
		public int Rows = (int)((ulong)1L);

		// Token: 0x0400376E RID: 14190
		[FieldOffset(Offset = "0x5C")]
		[Token(Token = "0x400376E")]
		[Range(1f, 64f)]
		[Tooltip("The number of columns in the texture. Used for animation.")]
		public int Columns = (int)((ulong)1L);

		// Token: 0x0400376F RID: 14191
		[FieldOffset(Offset = "0x60")]
		[Token(Token = "0x400376F")]
		[Tooltip("The animation mode for the lightning")]
		public LightningBoltAnimationMode AnimationMode = (LightningBoltAnimationMode)((ulong)3L);

		// Token: 0x04003770 RID: 14192
		[FieldOffset(Offset = "0x68")]
		[Token(Token = "0x4003770")]
		[HideInInspector]
		[NonSerialized]
		public System.Random RandomGenerator;

		// Token: 0x04003771 RID: 14193
		[FieldOffset(Offset = "0x70")]
		[Token(Token = "0x4003771")]
		private LineRenderer lineRenderer;

		// Token: 0x04003772 RID: 14194
		[FieldOffset(Offset = "0x78")]
		[Token(Token = "0x4003772")]
		private List<KeyValuePair<Vector3, Vector3>> segments;

		// Token: 0x04003773 RID: 14195
		[FieldOffset(Offset = "0x80")]
		[Token(Token = "0x4003773")]
		private int startIndex;

		// Token: 0x04003774 RID: 14196
		[FieldOffset(Offset = "0x84")]
		[Token(Token = "0x4003774")]
		private Vector2 size;

		// Token: 0x04003775 RID: 14197
		[FieldOffset(Offset = "0x90")]
		[Token(Token = "0x4003775")]
		private Vector2[] offsets;

		// Token: 0x04003776 RID: 14198
		[FieldOffset(Offset = "0x98")]
		[Token(Token = "0x4003776")]
		private int animationOffsetIndex;

		// Token: 0x04003777 RID: 14199
		[FieldOffset(Offset = "0x9C")]
		[Token(Token = "0x4003777")]
		private int animationPingPongDirection;

		// Token: 0x04003778 RID: 14200
		[FieldOffset(Offset = "0xA0")]
		[Token(Token = "0x4003778")]
		private bool orthographic;
	}
}
