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

namespace DigitalRuby.LightningBolt
{
	// Token: 0x020005E6 RID: 1510
	[Token(Token = "0x20005E6")]
	[RequireComponent(typeof(LineRenderer))]
	public class LightningBoltScript : MonoBehaviour
	{
		// Token: 0x06003156 RID: 12630 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6003156")]
		[Address(RVA = "0x417730", Offset = "0x416730", VA = "0x180417730")]
		private void GetPerpendicularVector(ref Vector3 directionNormalized, out Vector3 side)
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x06003157 RID: 12631 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6003157")]
		[Address(RVA = "0x4171C0", Offset = "0x4161C0", VA = "0x1804171C0")]
		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: 0x06003158 RID: 12632 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6003158")]
		[Address(RVA = "0x417880", Offset = "0x416880", VA = "0x180417880")]
		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: 0x06003159 RID: 12633 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x6003159")]
		[Address(RVA = "0x417C50", Offset = "0x416C50", VA = "0x180417C50")]
		private void SelectOffsetFromAnimationMode()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x0600315A RID: 12634 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x600315A")]
		[Address(RVA = "0x418350", Offset = "0x417350", VA = "0x180418350")]
		private void UpdateLineRenderer()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x0600315B RID: 12635 RVA: 0x0006A68C File Offset: 0x0006888C
		[Token(Token = "0x600315B")]
		[Address(RVA = "0x417E70", Offset = "0x416E70", VA = "0x180417E70")]
		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: 0x0600315C RID: 12636 RVA: 0x0006A6F4 File Offset: 0x000688F4
		[Token(Token = "0x600315C")]
		[Address(RVA = "0x418570", Offset = "0x417570", VA = "0x180418570")]
		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: 0x0600315D RID: 12637 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x600315D")]
		[Address(RVA = "0x417F50", Offset = "0x416F50", VA = "0x180417F50")]
		public void Trigger()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x0600315E RID: 12638 RVA: 0x000020D3 File Offset: 0x000002D3
		[Token(Token = "0x600315E")]
		[Address(RVA = "0x4181D0", Offset = "0x4171D0", VA = "0x1804181D0")]
		public void UpdateFromMaterialChange()
		{
			throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
		}

		// Token: 0x0600315F RID: 12639 RVA: 0x0006A784 File Offset: 0x00068984
		[Token(Token = "0x600315F")]
		[Address(RVA = "0x418660", Offset = "0x417660", VA = "0x180418660")]
		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: 0x04003A4E RID: 14926
		[FieldOffset(Offset = "0x18")]
		[Token(Token = "0x4003A4E")]
		[Tooltip("The game object where the lightning will emit from. If null, StartPosition is used.")]
		public GameObject StartObject;

		// Token: 0x04003A4F RID: 14927
		[FieldOffset(Offset = "0x20")]
		[Token(Token = "0x4003A4F")]
		[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: 0x04003A50 RID: 14928
		[FieldOffset(Offset = "0x30")]
		[Token(Token = "0x4003A50")]
		[Tooltip("The game object where the lightning will end at. If null, EndPosition is used.")]
		public GameObject EndObject;

		// Token: 0x04003A51 RID: 14929
		[FieldOffset(Offset = "0x38")]
		[Token(Token = "0x4003A51")]
		[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: 0x04003A52 RID: 14930
		[FieldOffset(Offset = "0x44")]
		[Token(Token = "0x4003A52")]
		[Range(0f, 8f)]
		[Tooltip("How manu generations? Higher numbers create more line segments.")]
		public int Generations = (int)((ulong)6L);

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

		// Token: 0x04003A54 RID: 14932
		[FieldOffset(Offset = "0x4C")]
		[Token(Token = "0x4003A54")]
		private float timer;

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

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

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

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

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

		// Token: 0x04003A5A RID: 14938
		[FieldOffset(Offset = "0x68")]
		[Token(Token = "0x4003A5A")]
		[HideInInspector]
		[NonSerialized]
		public System.Random RandomGenerator;

		// Token: 0x04003A5B RID: 14939
		[FieldOffset(Offset = "0x70")]
		[Token(Token = "0x4003A5B")]
		private LineRenderer lineRenderer;

		// Token: 0x04003A5C RID: 14940
		[FieldOffset(Offset = "0x78")]
		[Token(Token = "0x4003A5C")]
		private List<KeyValuePair<Vector3, Vector3>> segments;

		// Token: 0x04003A5D RID: 14941
		[FieldOffset(Offset = "0x80")]
		[Token(Token = "0x4003A5D")]
		private int startIndex;

		// Token: 0x04003A5E RID: 14942
		[FieldOffset(Offset = "0x84")]
		[Token(Token = "0x4003A5E")]
		private Vector2 size;

		// Token: 0x04003A5F RID: 14943
		[FieldOffset(Offset = "0x90")]
		[Token(Token = "0x4003A5F")]
		private Vector2[] offsets;

		// Token: 0x04003A60 RID: 14944
		[FieldOffset(Offset = "0x98")]
		[Token(Token = "0x4003A60")]
		private int animationOffsetIndex;

		// Token: 0x04003A61 RID: 14945
		[FieldOffset(Offset = "0x9C")]
		[Token(Token = "0x4003A61")]
		private int animationPingPongDirection;

		// Token: 0x04003A62 RID: 14946
		[FieldOffset(Offset = "0xA0")]
		[Token(Token = "0x4003A62")]
		private bool orthographic;
	}
}
