using System;
using UnityEngine;

namespace cakeslice
{
	// Token: 0x02000112 RID: 274
	[RequireComponent(typeof(Renderer))]
	public class Outline : MonoBehaviour
	{
		// Token: 0x17000059 RID: 89
		// (get) Token: 0x0600166F RID: 5743 RVA: 0x0019E5B4 File Offset: 0x0019C7B4
		// (set) Token: 0x06001670 RID: 5744 RVA: 0x0019E5BC File Offset: 0x0019C7BC
		public Renderer Renderer { get; private set; }

		// Token: 0x1700005A RID: 90
		// (get) Token: 0x06001671 RID: 5745 RVA: 0x0019E5C5 File Offset: 0x0019C7C5
		// (set) Token: 0x06001672 RID: 5746 RVA: 0x0019E5CD File Offset: 0x0019C7CD
		public SkinnedMeshRenderer SkinnedMeshRenderer { get; private set; }

		// Token: 0x1700005B RID: 91
		// (get) Token: 0x06001673 RID: 5747 RVA: 0x0019E5D6 File Offset: 0x0019C7D6
		// (set) Token: 0x06001674 RID: 5748 RVA: 0x0019E5DE File Offset: 0x0019C7DE
		public MeshFilter MeshFilter { get; private set; }

		// Token: 0x06001675 RID: 5749 RVA: 0x0019E5E7 File Offset: 0x0019C7E7
		private void Awake()
		{
			this.Renderer = base.GetComponent<Renderer>();
			this.SkinnedMeshRenderer = base.GetComponent<SkinnedMeshRenderer>();
			this.MeshFilter = base.GetComponent<MeshFilter>();
		}

		// Token: 0x06001676 RID: 5750 RVA: 0x0019E60D File Offset: 0x0019C80D
		private void OnEnable()
		{
			OutlineEffect instance = OutlineEffect.Instance;
			if (instance == null)
			{
				return;
			}
			instance.AddOutline(this);
		}

		// Token: 0x06001677 RID: 5751 RVA: 0x0019E61F File Offset: 0x0019C81F
		private void OnDisable()
		{
			OutlineEffect instance = OutlineEffect.Instance;
			if (instance == null)
			{
				return;
			}
			instance.RemoveOutline(this);
		}

		// Token: 0x1700005C RID: 92
		// (get) Token: 0x06001678 RID: 5752 RVA: 0x0019E631 File Offset: 0x0019C831
		public Material[] SharedMaterials
		{
			get
			{
				if (this._SharedMaterials == null)
				{
					this._SharedMaterials = this.Renderer.sharedMaterials;
				}
				return this._SharedMaterials;
			}
		}

		// Token: 0x04002671 RID: 9841
		public int color;

		// Token: 0x04002672 RID: 9842
		public bool eraseRenderer;

		// Token: 0x04002673 RID: 9843
		private Material[] _SharedMaterials;
	}
}
