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

public class BoneMorph
{
	public static void Init()
	{
		BoneMorph.dic = new Dictionary<string, Vector3>();
		BoneMorph.SetPosition("KubiScl", "Bip01 Neck", 0.95f, 1f, 1f, 1.05f, 1f, 1f);
		BoneMorph.SetPosition("KubiScl", "Bip01 Head", 0.8f, 1f, 1f, 1.2f, 1f, 1f);
		BoneMorph.SetScale("UdeScl", "Bip01 ? UpperArm", 0.85f, 1f, 1f, 1.15f, 1f, 1f);
		BoneMorph.SetScale("EyeSclX", "Eyepos_L", 1f, 1f, 0.92f, 1f, 1f, 1.08f);
		BoneMorph.SetScale("EyeSclX", "Eyepos_R", 1f, 1f, 0.92f, 1f, 1f, 1.08f);
		BoneMorph.SetScale("EyeSclY", "Eyepos_L", 1f, 0.92f, 1f, 1f, 1.08f, 1f);
		BoneMorph.SetScale("EyeSclY", "Eyepos_R", 1f, 0.92f, 1f, 1f, 1.08f, 1f);
		BoneMorph.SetPosition("EyePosX", "Eyepos_R", 1f, 1f, 0.9f, 1f, 1f, 1.1f);
		BoneMorph.SetPosition("EyePosX", "Eyepos_L", 1f, 1f, 0.9f, 1f, 1f, 1.1f);
		BoneMorph.SetPosition("EyePosY", "Eyepos_R", 1f, 0.93f, 1f, 1f, 1.07f, 1f);
		BoneMorph.SetPosition("EyePosY", "Eyepos_L", 1f, 0.93f, 1f, 1f, 1.07f, 1f);
		BoneMorph.SetScale("HeadX", "Bip01 Head", 1f, 0.9f, 0.8f, 1f, 1.1f, 1.2f);
		BoneMorph.SetScale("HeadY", "Bip01 Head", 0.8f, 0.9f, 1f, 1.2f, 1.1f, 1f);
		BoneMorph.SetPosition("DouPer", "Bip01 Spine", 1f, 1f, 0.94f, 1f, 1f, 1.06f);
		BoneMorph.SetPosition("DouPer", "Bip01 Spine0a", 0.88f, 1f, 1f, 1.12f, 1f, 1f);
		BoneMorph.SetPosition("DouPer", "Bip01 Spine1", 0.88f, 1f, 1f, 1.12f, 1f, 1f);
		BoneMorph.SetPosition("DouPer", "Bip01 Spine1a", 0.88f, 1f, 1f, 1.12f, 1f, 1f);
		BoneMorph.SetPosition("DouPer", "Bip01 Neck", 1.03f, 1f, 1f, 0.97f, 1f, 1f);
		BoneMorph.SetPosition("DouPer", "Bip01 ? Calf", 0.87f, 1f, 1f, 1.13f, 1f, 1f);
		BoneMorph.SetPosition("DouPer", "Bip01 ? Foot", 0.87f, 1f, 1f, 1.13f, 1f, 1f);
		BoneMorph.SetScale("DouPer", "Bip01 ? Thigh_SCL_", 0.87f, 1f, 1f, 1.13f, 1f, 1f);
		BoneMorph.SetScale("DouPer", "momotwist_?", 0.87f, 1f, 1f, 1.13f, 1f, 1f);
		BoneMorph.SetScale("DouPer", "Bip01 ? Calf_SCL_", 0.87f, 1f, 1f, 1.13f, 1f, 1f);
		BoneMorph.SetScale("DouPer", "Bip01 ? UpperArm", 0.98f, 1f, 1f, 1.02f, 1f, 1f);
		BoneMorph.SetPosition("sintyou", "Bip01 Spine", 1f, 1f, 0.85f, 1f, 1f, 1.15f);
		BoneMorph.SetPosition("sintyou", "Bip01 Spine0a", 0.88f, 1f, 1f, 1.12f, 1f, 1f);
		BoneMorph.SetPosition("sintyou", "Bip01 Spine1", 0.88f, 1f, 1f, 1.12f, 1f, 1f);
		BoneMorph.SetPosition("sintyou", "Bip01 Spine1a", 0.88f, 1f, 1f, 1.12f, 1f, 1f);
		BoneMorph.SetPosition("sintyou", "Bip01 Neck", 0.97f, 1f, 1f, 1.03f, 1f, 1f);
		BoneMorph.SetPosition("sintyou", "Bip01 Head", 0.9f, 1f, 1f, 1.1f, 1f, 1f);
		BoneMorph.SetPosition("sintyou", "Bip01 ? Calf", 0.87f, 1f, 1f, 1.13f, 1f, 1f);
		BoneMorph.SetPosition("sintyou", "Bip01 ? Foot", 0.87f, 1f, 1f, 1.13f, 1f, 1f);
		BoneMorph.SetScale("sintyou", "Bip01 ? UpperArm", 0.9f, 1f, 1f, 1.1f, 1f, 1f);
		BoneMorph.SetScale("sintyou", "Bip01 ? Thigh_SCL_", 0.87f, 1f, 1f, 1.13f, 1f, 1f);
		BoneMorph.SetScale("sintyou", "momotwist_?", 0.87f, 1f, 1f, 1.13f, 1f, 1f);
		BoneMorph.SetScale("sintyou", "Bip01 ? Calf_SCL_", 0.87f, 1f, 1f, 1.13f, 1f, 1f);
		BoneMorph.SetScale("koshi", "Bip01 Pelvis_SCL_", 1f, 0.8f, 0.92f, 1f, 1.2f, 1.08f);
		BoneMorph.SetScale("koshi", "Bip01 Spine_SCL_", 1f, 1f, 1f, 1f, 1f, 1f);
		BoneMorph.SetScale("koshi", "Hip_?", 1f, 0.96f, 0.9f, 1f, 1.04f, 1.1f);
		BoneMorph.SetScale("koshi", "Skirt", 1f, 0.85f, 0.88f, 1f, 1.2f, 1.12f);
		BoneMorph.SetPosition("kata", "Bip01 ? Clavicle", 0.98f, 1f, 0.5f, 1.02f, 1f, 1.5f);
		BoneMorph.SetScale("kata", "Bip01 Spine1a_SCL_", 1f, 1f, 0.95f, 1f, 1f, 1.05f);
		BoneMorph.SetScale("west", "Bip01 Spine_SCL_", 1f, 0.95f, 0.9f, 1f, 1.05f, 1.1f);
		BoneMorph.SetScale("west", "Bip01 Spine0a_SCL_", 1f, 0.85f, 0.7f, 1f, 1.15f, 1.3f);
		BoneMorph.SetScale("west", "Bip01 Spine1_SCL_", 1f, 0.9f, 0.85f, 1f, 1.1f, 1.15f);
		BoneMorph.SetScale("west", "Bip01 Spine1a_SCL_", 1f, 0.95f, 0.95f, 1f, 1.05f, 1.05f);
		BoneMorph.SetScale("west", "Skirt", 1f, 0.92f, 0.88f, 1f, 1.08f, 1.12f);
	}

	private static void SetScale(string tag, string bname, float x, float y, float z, float x2, float y2, float z2)
	{
		string text = bname;
		List<BoneMorph.BoneProp> list;
		BoneMorph.BoneProp boneProp;
		if (bname.Contains("?"))
		{
			text = text.Replace('?', 'L');
			bname = bname.Replace('?', 'R');
			if (!BoneMorph.dic2.TryGetValue(bname, out list))
			{
				List<BoneMorph.BoneProp> list2 = new List<BoneMorph.BoneProp>();
				BoneMorph.dic2[bname] = list2;
				list = list2;
			}
			boneProp = list.Find((BoneMorph.BoneProp a) => a.strProp == tag);
			if (boneProp == null)
			{
				boneProp = new BoneMorph.BoneProp();
				list.Add(boneProp);
			}
			boneProp.strProp = tag;
			boneProp.nIndex = Array.FindIndex<string>(BoneMorph.PropNames, (string a) => a == tag);
			boneProp.bExistM = true;
			BoneMorph.dic["min+" + tag + "*" + bname] = (boneProp.vMinM = new Vector3(x, y, z));
			BoneMorph.dic["max+" + tag + "*" + bname] = (boneProp.vMaxM = new Vector3(x2, y2, z2));
		}
		if (!BoneMorph.dic2.TryGetValue(text, out list))
		{
			List<BoneMorph.BoneProp> list2 = new List<BoneMorph.BoneProp>();
			BoneMorph.dic2[text] = list2;
			list = list2;
		}
		boneProp = list.Find((BoneMorph.BoneProp a) => a.strProp == tag);
		if (boneProp == null)
		{
			boneProp = new BoneMorph.BoneProp();
			list.Add(boneProp);
		}
		boneProp.strProp = tag;
		boneProp.nIndex = Array.FindIndex<string>(BoneMorph.PropNames, (string a) => a == tag);
		boneProp.bExistM = true;
		BoneMorph.dic["min+" + tag + "*" + text] = (boneProp.vMinM = new Vector3(x, y, z));
		BoneMorph.dic["max+" + tag + "*" + text] = (boneProp.vMaxM = new Vector3(x2, y2, z2));
	}

	private static void SetPosition(string tag, string bname, float x, float y, float z, float x2, float y2, float z2)
	{
		string text = bname;
		List<BoneMorph.BoneProp> list;
		BoneMorph.BoneProp boneProp;
		if (bname.Contains("?"))
		{
			text = text.Replace('?', 'L');
			bname = bname.Replace('?', 'R');
			if (!BoneMorph.dic2.TryGetValue(bname, out list))
			{
				List<BoneMorph.BoneProp> list2 = new List<BoneMorph.BoneProp>();
				BoneMorph.dic2[bname] = list2;
				list = list2;
			}
			boneProp = list.Find((BoneMorph.BoneProp a) => a.strProp == tag);
			if (boneProp == null)
			{
				boneProp = new BoneMorph.BoneProp();
				list.Add(boneProp);
			}
			boneProp.strProp = tag;
			boneProp.nIndex = Array.FindIndex<string>(BoneMorph.PropNames, (string a) => a == tag);
			boneProp.bExistP = true;
			BoneMorph.dic["min+" + tag + "+" + bname] = (boneProp.vMinP = new Vector3(x, y, z));
			BoneMorph.dic["max+" + tag + "+" + bname] = (boneProp.vMaxP = new Vector3(x2, y2, z2));
		}
		if (!BoneMorph.dic2.TryGetValue(text, out list))
		{
			List<BoneMorph.BoneProp> list2 = new List<BoneMorph.BoneProp>();
			BoneMorph.dic2[text] = list2;
			list = list2;
		}
		boneProp = list.Find((BoneMorph.BoneProp a) => a.strProp == tag);
		if (boneProp == null)
		{
			boneProp = new BoneMorph.BoneProp();
			list.Add(boneProp);
		}
		boneProp.strProp = tag;
		boneProp.nIndex = Array.FindIndex<string>(BoneMorph.PropNames, (string a) => a == tag);
		boneProp.bExistP = true;
		BoneMorph.dic["min+" + tag + "+" + text] = (boneProp.vMinP = new Vector3(x, y, z));
		BoneMorph.dic["max+" + tag + "+" + text] = (boneProp.vMaxP = new Vector3(x2, y2, z2));
	}

	public static Dictionary<string, Vector3> dic = null;

	public static Dictionary<string, List<BoneMorph.BoneProp>> dic2 = new Dictionary<string, List<BoneMorph.BoneProp>>();

	public static string[] PropNames = new string[]
	{
		"KubiScl",
		"UdeScl",
		"EyeSclX",
		"EyeSclY",
		"EyePosX",
		"EyePosY",
		"HeadX",
		"HeadY",
		"DouPer",
		"sintyou",
		"koshi",
		"kata",
		"west",
		"MuneUpDown",
		"MuneYori"
	};

	public class BoneProp
	{
		public string strProp;

		public int nIndex;

		public bool bExistP;

		public bool bExistM;

		public Vector3 vMinP;

		public Vector3 vMaxP;

		public Vector3 vMinM;

		public Vector3 vMaxM;
	}
}
