using System;
using System.Runtime.InteropServices;
using Cpp2IlInjected;
using RootMotion.FinalIK;
using UnityEngine;

// Token: 0x02000364 RID: 868
[Token(Token = "0x2000364")]
[Serializable]
public class NobetaSkinController
{
	// Token: 0x170001D6 RID: 470
	// (get) Token: 0x060021D6 RID: 8662 RVA: 0x000520A0 File Offset: 0x000502A0
	[Token(Token = "0x170001D6")]
	public Transform AimTarget
	{
		[Token(Token = "0x60021D6")]
		[Address(RVA = "0x33F1F0", Offset = "0x33E1F0", VA = "0x18033F1F0")]
		get
		{
			return this.aimTarget;
		}
	}

	// Token: 0x170001D7 RID: 471
	// (get) Token: 0x060021D7 RID: 8663 RVA: 0x000520B4 File Offset: 0x000502B4
	[Token(Token = "0x170001D7")]
	public Transform LookAtObject
	{
		[Token(Token = "0x60021D7")]
		[Address(RVA = "0x3352E0", Offset = "0x3342E0", VA = "0x1803352E0")]
		get
		{
			return this.lookAtObject;
		}
	}

	// Token: 0x060021D8 RID: 8664 RVA: 0x000520C8 File Offset: 0x000502C8
	[Token(Token = "0x60021D8")]
	[Address(RVA = "0xF1C020", Offset = "0xF1B020", VA = "0x180F1C020")]
	public void Init(NobetaAnimatorController animator, Transform aimTarget, Transform lookAtObject)
	{
		/*
An exception occurred when decompiling this method (060021D8)

ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void NobetaSkinController::Init(NobetaAnimatorController,UnityEngine.Transform,UnityEngine.Transform)

 ---> System.Exception: Basic block has to end with unconditional control flow. 
{; 	Block_0:; 	stfld:NobetaAnimatorController(NobetaSkinController::animator, ldloc:NobetaSkinController(this), ldloc:NobetaAnimatorController(animator)); 	stfld:Transform(NobetaSkinController::aimTarget, ldloc:NobetaSkinController(this), ldloc:Transform(aimTarget)); 	stfld:Transform(NobetaSkinController::lookAtObject, ldloc:NobetaSkinController(this), ldloc:Transform(lookAtObject)); }; 
   at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1810
   at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 344
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
   --- End of inner exception stack trace ---
   at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
   at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1618
*/;
	}

	// Token: 0x060021D9 RID: 8665 RVA: 0x000520EC File Offset: 0x000502EC
	[Token(Token = "0x60021D9")]
	[Address(RVA = "0xF1C3F0", Offset = "0xF1B3F0", VA = "0x180F1C3F0")]
	public void Setup(NobetaSkin skin)
	{
		Transform transform = skin.transform;
		this.source = transform;
		NobetaIKController ikController = skin.ikController;
		this.ik = ikController;
		throw new NullReferenceException();
	}

	// Token: 0x060021DA RID: 8666 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60021DA")]
	[Address(RVA = "0xF1C440", Offset = "0xF1B440", VA = "0x180F1C440")]
	public void Update(float deltaTime)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060021DB RID: 8667 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60021DB")]
	[Address(RVA = "0xF1B9B0", Offset = "0xF1A9B0", VA = "0x180F1B9B0")]
	public void CalculateAimSystem(float deltaTime)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060021DC RID: 8668 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60021DC")]
	[Address(RVA = "0xF1BAC0", Offset = "0xF1AAC0", VA = "0x180F1BAC0")]
	public void CalculateLookAtSystem(float deltaTime)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060021DD RID: 8669 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60021DD")]
	[Address(RVA = "0xF1C260", Offset = "0xF1B260", VA = "0x180F1C260")]
	public void SetScriptLookAtTarget(Transform target, bool lerp = true)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060021DE RID: 8670 RVA: 0x0005211C File Offset: 0x0005031C
	[Token(Token = "0x60021DE")]
	[Address(RVA = "0xF1C130", Offset = "0xF1B130", VA = "0x180F1C130")]
	public void SetLookAtTarget(bool isScriptEnable, [Optional] Transform target)
	{
		if (!(this.lookAtTarget == target))
		{
			Transform transform = this.scriptLookAtTarget;
			int num = 0;
			if (transform != num)
			{
				if (!isScriptEnable)
				{
					goto IL_39;
				}
				int num2 = 0;
				if (!(target != num2))
				{
				}
			}
			this.lookAtTarget = target;
			IL_39:
			this.scriptStopTimer = 2f;
			this.lookAtTarget = (ulong)0L;
		}
	}

	// Token: 0x060021DF RID: 8671 RVA: 0x00052178 File Offset: 0x00050378
	[Token(Token = "0x60021DF")]
	[Address(RVA = "0x75AF50", Offset = "0x759F50", VA = "0x18075AF50")]
	public void SetAimIKWeight(float aimIKStayTime)
	{
		this.aimIKStayTime = aimIKStayTime;
	}

	// Token: 0x060021E0 RID: 8672 RVA: 0x0005218C File Offset: 0x0005038C
	[Token(Token = "0x60021E0")]
	[Address(RVA = "0xF1C080", Offset = "0xF1B080", VA = "0x180F1C080")]
	public void SetIKZero(bool isIK)
	{
		if (isIK)
		{
			NobetaIKController nobetaIKController = this.ik;
			this.aimIKWeight = 0f;
			IKSolverAim solver = nobetaIKController.aimIK.solver;
			int num = 0;
			solver.SetIKPositionWeight((float)num);
		}
		this.scriptStopTimer = 2f;
		NobetaIKController nobetaIKController2 = this.ik;
		IKSolverLookAt solver2 = nobetaIKController2.lookAtIK.solver;
		int num2 = 0;
		solver2.SetLookAtWeight((float)num2);
		IKSolverCCD solver3 = nobetaIKController2.hairIK.solver;
		int num3 = 0;
		solver3.SetIKPositionWeight((float)num3);
	}

	// Token: 0x060021E1 RID: 8673 RVA: 0x00052210 File Offset: 0x00050410
	[Token(Token = "0x60021E1")]
	[Address(RVA = "0x36ABD0", Offset = "0x369BD0", VA = "0x18036ABD0")]
	public NobetaSkinController()
	{
	}

	// Token: 0x04002BCF RID: 11215
	[Cpp2IlInjected.FieldOffset(Offset = "0x10")]
	[Token(Token = "0x4002BCF")]
	[SerializeField]
	private float aimIKWeight;

	// Token: 0x04002BD0 RID: 11216
	[Cpp2IlInjected.FieldOffset(Offset = "0x14")]
	[Token(Token = "0x4002BD0")]
	[SerializeField]
	private float aimIKStayTime;

	// Token: 0x04002BD1 RID: 11217
	[Cpp2IlInjected.FieldOffset(Offset = "0x18")]
	[Token(Token = "0x4002BD1")]
	[SerializeField]
	private float lookAtWeight;

	// Token: 0x04002BD2 RID: 11218
	[Cpp2IlInjected.FieldOffset(Offset = "0x20")]
	[Token(Token = "0x4002BD2")]
	[SerializeField]
	private Transform lookAtTarget;

	// Token: 0x04002BD3 RID: 11219
	[Cpp2IlInjected.FieldOffset(Offset = "0x28")]
	[Token(Token = "0x4002BD3")]
	[SerializeField]
	private Transform scriptLookAtTarget;

	// Token: 0x04002BD4 RID: 11220
	[Cpp2IlInjected.FieldOffset(Offset = "0x30")]
	[Token(Token = "0x4002BD4")]
	[SerializeField]
	private float scriptStopTimer;

	// Token: 0x04002BD5 RID: 11221
	[Token(Token = "0x4002BD5")]
	private const float SCRIPT_STOP_TIME = 2f;

	// Token: 0x04002BD6 RID: 11222
	[Cpp2IlInjected.FieldOffset(Offset = "0x38")]
	[Token(Token = "0x4002BD6")]
	private NobetaAnimatorController animator;

	// Token: 0x04002BD7 RID: 11223
	[Cpp2IlInjected.FieldOffset(Offset = "0x40")]
	[Token(Token = "0x4002BD7")]
	private Transform aimTarget;

	// Token: 0x04002BD8 RID: 11224
	[Cpp2IlInjected.FieldOffset(Offset = "0x48")]
	[Token(Token = "0x4002BD8")]
	private Transform lookAtObject;

	// Token: 0x04002BD9 RID: 11225
	[Cpp2IlInjected.FieldOffset(Offset = "0x50")]
	[Token(Token = "0x4002BD9")]
	private Transform source;

	// Token: 0x04002BDA RID: 11226
	[Cpp2IlInjected.FieldOffset(Offset = "0x58")]
	[Token(Token = "0x4002BDA")]
	private NobetaIKController ik;
}
