Want more features on Pastebin? Sign Up, it's FREE!

characreator

By: devilkkw on Jan 5th, 2015  |  syntax: C#  |  size: 94.39 KB  |  views: 88  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. using FBSAssist;
  2. using Helper;
  3. using IllusionUtility.GetUtility;
  4. using IllusionUtility.SetUtility;
  5. using Manager;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.IO;
  9. using System.Runtime.CompilerServices;
  10. using System.Runtime.InteropServices;
  11. using UnityEngine;
  12.  
  13. [Serializable]
  14. public class CharFemale : CharBase
  15. {
  16.     [CompilerGenerated]
  17.     private static Dictionary<string, int> <>f__switch$map6;
  18.     private int?[] acsNo = new int?[9];
  19.     private AudioSource asMain;
  20.     private AudioSource asSub;
  21.     private FBSBlinkControl blinkCtrl = new FBSBlinkControl();
  22.     public BodySubInfoClass BodySubInfo = new BodySubInfoClass();
  23.     public BustScaleInfo bustScaleInfo = new BustScaleInfo();
  24.     private bool charaCreateFlag;
  25.     private int charaNo = -1;
  26.     private CharCustom charCustom;
  27.     private float cheekAlpha;
  28.     private byte?[] cosAcsState = new byte?[9];
  29.     private byte? cosBottomState;
  30.     private byte? cosBottomType;
  31.     private byte? cosBuraState;
  32.     private CosCustom cosCustom;
  33.     private byte?[] cosOptionsState = new byte?[2];
  34.     private byte? cosPanstState;
  35.     private byte? cosPantsState;
  36.     private byte? cosShoesState;
  37.     private byte? cosSocksState;
  38.     private byte? cosSodeType;
  39.     private byte? cosTopState;
  40.     private bool customUpdate = true;
  41.     private const string deleteBoneName = "cf_Joint_00";
  42.     protected Dictionary<E_REF_NAME, GameObject> dictRefObj = new Dictionary<E_REF_NAME, GameObject>();
  43.     private FBSCtrlEyebrow EyebrowCtrl;
  44.     private EyeLookController eyeLookCtrl;
  45.     public EyeScaleInfo eyeScaleInfo = new EyeScaleInfo();
  46.     private FBSCtrlEyes EyesCtrl;
  47.     private bool eyesHi = true;
  48.     private AudioAssist fbsaaVoice = new AudioAssist();
  49.     private FaceBlendShape fbsCtrlELine;
  50.     private FaceBlendShape fbsCtrlHead;
  51.     public string female_dir = "Prefabs/chara/female/";
  52.     private List<GameObject> listMeshHairB = new List<GameObject>();
  53.     private List<GameObject> listMeshHairF = new List<GameObject>();
  54.     private List<GameObject> listMeshHairO = new List<GameObject>();
  55.     private List<GameObject> listMeshHairS = new List<GameObject>();
  56.     private List<GameObject> listTagColHair = new List<GameObject>();
  57.     private List<GameObject> listTagEyeblow = new List<GameObject>();
  58.     private List<GameObject> listTagEyeHi = new List<GameObject>();
  59.     private List<GameObject> listTagEyeL = new List<GameObject>();
  60.     private List<GameObject> listTagEyeline = new List<GameObject>();
  61.     private List<GameObject> listTagEyeR = new List<GameObject>();
  62.     private List<GameObject> listTagNail = new List<GameObject>();
  63.     private List<GameObject> listTagNip = new List<GameObject>();
  64.     private List<GameObject> listTagSkinB = new List<GameObject>();
  65.     private List<GameObject> listTagSkinE = new List<GameObject>();
  66.     private List<GameObject> listTagSkinF = new List<GameObject>();
  67.     private List<GameObject> listTagUHair = new List<GameObject>();
  68.     public int LoadVersion = 100;
  69.     public bool lockParam;
  70.     private int lookTargetE;
  71.     private int lookTargetN;
  72.     private FBSCtrlMouth MouthCtrl;
  73.     private NeckLookController neckLookCtrl;
  74.     private GameObject[] objAcs = new GameObject[9];
  75.     private GameObject objEyeline;
  76.     private GameObject objHairB;
  77.     private GameObject objHairF;
  78.     private GameObject objHairO;
  79.     private GameObject objHairS;
  80.     private GameObject objPanst;
  81.     private GameObject objShoes;
  82.     private GameObject objSocks;
  83.     private int? panstNo;
  84.     public PreviewInfo prevInfo = new PreviewInfo();
  85.     private int ptnBsEyeblow;
  86.     private int ptnBsEyes;
  87.     private int ptnBsMouth;
  88.     private string saveFileName = string.Empty;
  89.     public const string SaveMark = "【HaremMate Chara SaveData】";
  90.     private byte[] saveTexBytes;
  91.     public const int SaveVersion = 0x6b;
  92.     private int? shoesNo;
  93.     private int[] siruLv = new int[2];
  94.     private int? socksNo;
  95.     private FemaleHStatus status;
  96.     private byte? tongueType;
  97.     private int[] updateSiruLv = new int[2];
  98.  
  99.     public void ChangeAccessory(E_ACS_KIND kind, int No, bool forceChange = false)
  100.     {
  101.         int index = (int) kind;
  102.         bool flag = false;
  103.         if (forceChange)
  104.         {
  105.             if (-1 != this.acsNo[index])
  106.             {
  107.                 this.acsNo[index] = -2;
  108.             }
  109.         }
  110.         else if ((-1 != this.acsNo[index]) && (null == this.objAcs[index]))
  111.         {
  112.             this.acsNo[index] = -2;
  113.         }
  114.         GameObject refObject = null;
  115.         ListInfo.EInfoType type = ListInfo.EInfoType.ELI_F_AcsCap;
  116.         string name = string.Empty;
  117.         switch (kind)
  118.         {
  119.             case E_ACS_KIND.ACS_CAP:
  120.                 refObject = this.GetRefObject(E_REF_NAME.cf_J_Head_s);
  121.                 type = ListInfo.EInfoType.ELI_F_AcsCap;
  122.                 name = "cf_acs_cap";
  123.                 break;
  124.  
  125.             case E_ACS_KIND.ACS_MEGANE:
  126.                 refObject = this.GetRefObject(E_REF_NAME.NP_cf_acs_megane);
  127.                 type = ListInfo.EInfoType.ELI_F_AcsMegane;
  128.                 name = "cf_acs_megane";
  129.                 break;
  130.  
  131.             case E_ACS_KIND.ACS_EARRINGS:
  132.                 refObject = this.GetRefObject(E_REF_NAME.cf_J_Head_s);
  133.                 type = ListInfo.EInfoType.ELI_F_AcsEarrings;
  134.                 name = "cf_acs_earrings";
  135.                 break;
  136.  
  137.             case E_ACS_KIND.ACS_HEAD:
  138.                 refObject = this.GetRefObject(E_REF_NAME.cf_J_Head_s);
  139.                 type = ListInfo.EInfoType.ELI_F_AcsHead;
  140.                 name = "cf_acs_head";
  141.                 break;
  142.  
  143.             case E_ACS_KIND.ACS_BACK:
  144.                 refObject = this.GetRefObject(E_REF_NAME.NP_cf_acs_back);
  145.                 type = ListInfo.EInfoType.ELI_F_AcsBack;
  146.                 name = "cf_acs_back";
  147.                 break;
  148.  
  149.             case E_ACS_KIND.ACS_WAIST:
  150.                 refObject = this.GetRefObject(E_REF_NAME.NP_cf_acs_waist);
  151.                 type = ListInfo.EInfoType.ELI_F_AcsWaist;
  152.                 name = "cf_acs_waist";
  153.                 break;
  154.  
  155.             case E_ACS_KIND.ACS_WRIST_L:
  156.                 refObject = this.GetRefObject(E_REF_NAME.NP_cf_acs_wrist_l);
  157.                 type = ListInfo.EInfoType.ELI_F_AcsWristL;
  158.                 name = "cf_acs_wrist_l";
  159.                 break;
  160.  
  161.             case E_ACS_KIND.ACS_WRIST_R:
  162.                 refObject = this.GetRefObject(E_REF_NAME.NP_cf_acs_wrist_r);
  163.                 type = ListInfo.EInfoType.ELI_F_AcsWristR;
  164.                 name = "cf_acs_wrist_r";
  165.                 break;
  166.  
  167.             case E_ACS_KIND.ACS_NECK:
  168.                 refObject = this.GetRefObject(E_REF_NAME.NP_cf_acs_neck);
  169.                 type = ListInfo.EInfoType.ELI_F_AcsNeck;
  170.                 name = "cf_acs_neck";
  171.                 flag = true;
  172.                 break;
  173.         }
  174.         if ((No != -1) && (No != this.acsNo[index]))
  175.         {
  176.             if (this.objAcs[index] != null)
  177.             {
  178.                 CommonAssist.Destroy(ref this.objAcs[index]);
  179.             }
  180.             Dictionary<int, ListTypeChara> charaObjList = base.listInfo.GetCharaObjList(type, true);
  181.             if (!charaObjList.ContainsKey(No))
  182.             {
  183.                 No = 0;
  184.             }
  185.             this.objAcs[index] = CommonAssist.LoadCloneFromAssetBundle(charaObjList[No].ABName, charaObjList[No].PName, name, base.objTop);
  186.             if (null != this.objAcs[index])
  187.             {
  188.                 if (flag)
  189.                 {
  190.                     if (base.aaWeights != null)
  191.                     {
  192.                         base.aaWeights.AssignedWeights(this.objAcs[index], "cf_Joint_00");
  193.                     }
  194.                 }
  195.                 else if (null != refObject)
  196.                 {
  197.                     this.objAcs[index].transform.parent = refObject.transform;
  198.                     this.objAcs[index].transform.SetLocalPosition(0f, 0f, 0f);
  199.                     this.objAcs[index].transform.SetLocalRotation(0f, 0f, 0f);
  200.                     this.objAcs[index].transform.SetLocalScale(1f, 1f, 1f);
  201.                 }
  202.             }
  203.             this.acsNo[index] = new int?(No);
  204.         }
  205.         switch (kind)
  206.         {
  207.             case E_ACS_KIND.ACS_CAP:
  208.                 this.InitRefObject(0x40);
  209.                 break;
  210.  
  211.             case E_ACS_KIND.ACS_MEGANE:
  212.                 this.InitRefObject(0x80);
  213.                 break;
  214.  
  215.             case E_ACS_KIND.ACS_EARRINGS:
  216.                 this.InitRefObject(0x100);
  217.                 break;
  218.  
  219.             case E_ACS_KIND.ACS_HEAD:
  220.                 this.InitRefObject(0x200);
  221.                 break;
  222.  
  223.             case E_ACS_KIND.ACS_BACK:
  224.                 this.InitRefObject(0x400);
  225.                 break;
  226.  
  227.             case E_ACS_KIND.ACS_WAIST:
  228.                 this.InitRefObject(0x800);
  229.                 break;
  230.  
  231.             case E_ACS_KIND.ACS_WRIST_L:
  232.                 this.InitRefObject(0x1000);
  233.                 break;
  234.  
  235.             case E_ACS_KIND.ACS_WRIST_R:
  236.                 this.InitRefObject(0x2000);
  237.                 break;
  238.  
  239.             case E_ACS_KIND.ACS_NECK:
  240.                 this.InitRefObject(0x4000);
  241.                 break;
  242.         }
  243.         byte? nullable4 = this.cosAcsState[index];
  244.         this.ChangeCosAcsState(kind, !nullable4.HasValue ? ((byte) 0) : nullable4.Value, true);
  245.     }
  246.  
  247.     public void ChangeAccessory(int CapNo = -1, int MeganeNo = -1, int EarringsNo = -1, int HeadNo = -1, int backNo = -1, int waistNo = -1, int wristLNo = -1, int wristRNo = -1, int neckNo = -1, bool forceChange = false)
  248.     {
  249.         this.ChangeAccessory(E_ACS_KIND.ACS_CAP, CapNo, forceChange);
  250.         this.ChangeAccessory(E_ACS_KIND.ACS_MEGANE, MeganeNo, forceChange);
  251.         this.ChangeAccessory(E_ACS_KIND.ACS_EARRINGS, EarringsNo, forceChange);
  252.         this.ChangeAccessory(E_ACS_KIND.ACS_HEAD, HeadNo, forceChange);
  253.         this.ChangeAccessory(E_ACS_KIND.ACS_BACK, backNo, forceChange);
  254.         this.ChangeAccessory(E_ACS_KIND.ACS_WAIST, waistNo, forceChange);
  255.         this.ChangeAccessory(E_ACS_KIND.ACS_WRIST_L, wristLNo, forceChange);
  256.         this.ChangeAccessory(E_ACS_KIND.ACS_WRIST_R, wristRNo, forceChange);
  257.         this.ChangeAccessory(E_ACS_KIND.ACS_NECK, neckNo, forceChange);
  258.     }
  259.  
  260.     public void ChangeAccessoryFromSetting(bool forceChange = true)
  261.     {
  262.         int? nullable = this.acsNo[0];
  263.         int? nullable2 = this.acsNo[1];
  264.         int? nullable3 = this.acsNo[2];
  265.         int? nullable4 = this.acsNo[3];
  266.         int? nullable5 = this.acsNo[4];
  267.         int? nullable6 = this.acsNo[5];
  268.         int? nullable7 = this.acsNo[6];
  269.         int? nullable8 = this.acsNo[7];
  270.         int? nullable9 = this.acsNo[8];
  271.         this.ChangeAccessory(!nullable.HasValue ? 0 : nullable.Value, !nullable2.HasValue ? 0 : nullable2.Value, !nullable3.HasValue ? 0 : nullable3.Value, !nullable4.HasValue ? 0 : nullable4.Value, !nullable5.HasValue ? 0 : nullable5.Value, !nullable6.HasValue ? 0 : nullable6.Value, !nullable7.HasValue ? 0 : nullable7.Value, !nullable8.HasValue ? 0 : nullable8.Value, !nullable9.HasValue ? 0 : nullable9.Value, forceChange);
  272.     }
  273.  
  274.     public void ChangeActive(E_REF_NAME nameID, bool active)
  275.     {
  276.         GameObject refObject = this.GetRefObject(nameID);
  277.         if (null != refObject)
  278.         {
  279.             refObject.SetActive(active);
  280.         }
  281.     }
  282.  
  283.     public void ChangeAndSaveLockParam(string loadfilename, bool lockFlag)
  284.     {
  285.         this.charCustom = new CharCustom();
  286.         this.charCustom.Init(this, Singleton<Character>.Instance.listinfo);
  287.         this.cosCustom = new CosCustom();
  288.         this.cosCustom.Init(this, Singleton<Character>.Instance.listinfo);
  289.         GameObject obj2 = new GameObject("work");
  290.         this.status = obj2.AddComponent<FemaleHStatus>();
  291.         this.LoadCharaData(loadfilename, 0);
  292.         this.lockParam = lockFlag;
  293.         this.OverwriteCharaData(string.Empty);
  294.         UnityEngine.Object.Destroy(obj2);
  295.         obj2 = null;
  296.     }
  297.  
  298.     public void ChangeBody(int _bodyNo = -1, int _panstNo = -1, int _socksNo = -1, int _shoesNo = -1, bool forceChange = false)
  299.     {
  300.         if (forceChange)
  301.         {
  302.             if (_bodyNo != -1)
  303.             {
  304.                 base.bodyNo = -2;
  305.             }
  306.             if (_panstNo != -1)
  307.             {
  308.                 this.panstNo = -2;
  309.             }
  310.             if (_socksNo != -1)
  311.             {
  312.                 this.socksNo = -2;
  313.             }
  314.             if (_shoesNo != -1)
  315.             {
  316.                 this.shoesNo = -2;
  317.             }
  318.         }
  319.         else
  320.         {
  321.             if ((_bodyNo != -1) && (null == base.objBody))
  322.             {
  323.                 base.bodyNo = -2;
  324.             }
  325.             if ((_panstNo != -1) && (null == this.objPanst))
  326.             {
  327.                 this.panstNo = -2;
  328.             }
  329.             if ((_socksNo != -1) && (null == this.objSocks))
  330.             {
  331.                 this.socksNo = -2;
  332.             }
  333.             if ((_shoesNo != -1) && (null == this.objShoes))
  334.             {
  335.                 this.shoesNo = -2;
  336.             }
  337.         }
  338.         if ((_bodyNo != -1) && (_bodyNo != base.bodyNo))
  339.         {
  340.             if (base.objBody != null)
  341.             {
  342.                 this.bustScaleInfo.Release();
  343.                 CommonAssist.Destroy(ref this.objBody);
  344.             }
  345.             Dictionary<int, ListTypeChara> charaObjList = base.listInfo.GetCharaObjList(ListInfo.EInfoType.ELI_F_Body, true);
  346.             if (!charaObjList.ContainsKey(_bodyNo))
  347.             {
  348.                 _bodyNo = 0;
  349.             }
  350.             string str = string.Empty;
  351.             base.objBody = CommonAssist.LoadCloneFromAssetBundle(charaObjList[_bodyNo].ABName, charaObjList[_bodyNo].PName, "cf_body", base.objTop);
  352.             if ((null != base.objBody) && (base.aaWeights != null))
  353.             {
  354.                 base.aaWeights.AssignedWeights(base.objBody, "cf_Joint_00");
  355.             }
  356.             this.bustScaleInfo.LoadNormalData(charaObjList[_bodyNo].ABName, this.female_dir + str + charaObjList[_bodyNo].PName + "_Nml");
  357.             this.bustScaleInfo.InitTargetObj(base.objBody);
  358.             this.BodySubInfo.SetFlags(charaObjList[_bodyNo].Type);
  359.             Texture[] tex = new Texture[4];
  360.             for (int i = 0; i < 4; i++)
  361.             {
  362.                 string resourcePath = "Prefabs/chara/etc/cf_t_mnpb_00_" + i.ToString("00");
  363.                 tex[i] = Helper.Loader.Load("chara/cha_etc.unity3d", resourcePath, typeof(Texture)) as Texture;
  364.             }
  365.             string[] strArray = new string[] { "cf_O_mnpa_00", "cf_O_mnpb_00" };
  366.             for (int j = 0; j < 2; j++)
  367.             {
  368.                 GameObject obj2 = base.objBody.transform.FindLoop(strArray[j]);
  369.                 if (null == obj2)
  370.                 {
  371.                     Debug.LogError("モザイクオブジェクトが認識できません");
  372.                 }
  373.                 else
  374.                 {
  375.                     obj2.AddComponent<ChangePtnAnime>().Init(tex);
  376.                 }
  377.             }
  378.             base.bodyNo = new int?(_bodyNo);
  379.             this.siruLv[1] = 0;
  380.         }
  381.         if ((_panstNo != -1) && (_panstNo != this.panstNo))
  382.         {
  383.             if (this.objPanst != null)
  384.             {
  385.                 CommonAssist.Destroy(ref this.objPanst);
  386.             }
  387.             Dictionary<int, ListTypeChara> dictionary2 = base.listInfo.GetCharaObjList(ListInfo.EInfoType.ELI_F_Panst, true);
  388.             if (!dictionary2.ContainsKey(_panstNo))
  389.             {
  390.                 _panstNo = 0;
  391.             }
  392.             this.objPanst = CommonAssist.LoadCloneFromAssetBundle(dictionary2[_panstNo].ABName, dictionary2[_panstNo].PName, "cf_panst", base.objTop);
  393.             if ((null != this.objPanst) && (base.aaWeights != null))
  394.             {
  395.                 base.aaWeights.AssignedWeights(this.objPanst, "cf_Joint_00");
  396.             }
  397.             this.panstNo = new int?(_panstNo);
  398.         }
  399.         if ((_socksNo != -1) && (_socksNo != this.socksNo))
  400.         {
  401.             if (this.objSocks != null)
  402.             {
  403.                 CommonAssist.Destroy(ref this.objSocks);
  404.             }
  405.             Dictionary<int, ListTypeChara> dictionary3 = base.listInfo.GetCharaObjList(ListInfo.EInfoType.ELI_F_Socks, true);
  406.             if (!dictionary3.ContainsKey(_socksNo))
  407.             {
  408.                 _socksNo = 0;
  409.             }
  410.             this.objSocks = CommonAssist.LoadCloneFromAssetBundle(dictionary3[_socksNo].ABName, dictionary3[_socksNo].PName, "cf_socks", base.objTop);
  411.             if ((null != this.objSocks) && (base.aaWeights != null))
  412.             {
  413.                 base.aaWeights.AssignedWeights(this.objSocks, "cf_Joint_00");
  414.             }
  415.             this.socksNo = new int?(_socksNo);
  416.         }
  417.         if ((_shoesNo != -1) && (_shoesNo != this.shoesNo))
  418.         {
  419.             if (this.objShoes != null)
  420.             {
  421.                 CommonAssist.Destroy(ref this.objShoes);
  422.             }
  423.             Dictionary<int, ListTypeChara> dictionary4 = base.listInfo.GetCharaObjList(ListInfo.EInfoType.ELI_F_Shoes, true);
  424.             if (!dictionary4.ContainsKey(_shoesNo))
  425.             {
  426.                 _shoesNo = 0;
  427.             }
  428.             this.objShoes = CommonAssist.LoadCloneFromAssetBundle(dictionary4[_shoesNo].ABName, dictionary4[_shoesNo].PName, "cf_shoes", base.objTop);
  429.             if ((null != this.objShoes) && (base.aaWeights != null))
  430.             {
  431.                 base.aaWeights.AssignedWeights(this.objShoes, "cf_Joint_00");
  432.             }
  433.             this.shoesNo = new int?(_shoesNo);
  434.         }
  435.         this.InitRefObject(0x3a);
  436.         this.GetMeshInBodyFromTag();
  437.         byte? cosTopState = this.cosTopState;
  438.         this.ChangeCosTopState(!cosTopState.HasValue ? ((byte) 0) : cosTopState.Value, true);
  439.         byte? cosSodeType = this.cosSodeType;
  440.         this.ChangeCosSodeType(!cosSodeType.HasValue ? ((byte) 1) : cosSodeType.Value, true);
  441.         byte? cosBottomType = this.cosBottomType;
  442.         this.ChangeCosBottomType(!cosBottomType.HasValue ? ((byte) 0) : cosBottomType.Value, true);
  443.         byte? cosBottomState = this.cosBottomState;
  444.         this.ChangeCosBottomState(!cosBottomState.HasValue ? ((byte) 0) : cosBottomState.Value, true);
  445.         byte? cosBuraState = this.cosBuraState;
  446.         this.ChangeCosBuraState(!cosBuraState.HasValue ? ((byte) 0) : cosBuraState.Value, true);
  447.         byte? cosPantsState = this.cosPantsState;
  448.         this.ChangeCosPantsState(!cosPantsState.HasValue ? ((byte) 0) : cosPantsState.Value, true);
  449.         byte? nullable11 = this.cosOptionsState[0];
  450.         this.ChangeCosOptionsState(0, !nullable11.HasValue ? ((byte) 0) : nullable11.Value, true);
  451.         byte? nullable12 = this.cosOptionsState[1];
  452.         this.ChangeCosOptionsState(1, !nullable12.HasValue ? ((byte) 0) : nullable12.Value, true);
  453.         byte? cosPanstState = this.cosPanstState;
  454.         this.ChangeCosPanstState(!cosPanstState.HasValue ? ((byte) 0) : cosPanstState.Value, true);
  455.         byte? cosSocksState = this.cosSocksState;
  456.         this.ChangeCosSocksState(!cosSocksState.HasValue ? ((byte) 0) : cosSocksState.Value, true);
  457.         byte? cosShoesState = this.cosShoesState;
  458.         this.ChangeCosShoesState(!cosShoesState.HasValue ? ((byte) 0) : cosShoesState.Value, true);
  459.         int? nipTexType = this.charCustom.nowCCI.nipTexType;
  460.         int? nipTexColor = this.charCustom.nowCCI.nipTexColor;
  461.         this.charCustom.ChangeTexNip(!nipTexType.HasValue ? 0 : nipTexType.Value, !nipTexColor.HasValue ? 0 : nipTexColor.Value, true);
  462.         this.charCustom.ChangeNipShader(this.charCustom.nowCCI.nipAlpha);
  463.         int? skinTexColor = this.charCustom.nowCCI.skinTexColor;
  464.         this.charCustom.ChangeTexSkin(!skinTexColor.HasValue ? 0 : skinTexColor.Value, true);
  465.         int? uhairTexType = this.charCustom.nowCCI.uhairTexType;
  466.         this.charCustom.ChangeTexUHair(!uhairTexType.HasValue ? 0 : uhairTexType.Value, true);
  467.         this.charCustom.ChangeUHairShader(this.charCustom.nowCCI.uhairColor, this.charCustom.nowCCI.uhairAlpha);
  468.         byte? tongueType = this.tongueType;
  469.         this.ChangeTongueKind(!tongueType.HasValue ? ((byte) 0) : tongueType.Value, true);
  470.         SystemEtcetera.EtcData etcData = Manager.Config.EtcData;
  471.         this.charCustom.ChangeTexSkinToon(etcData.data[4], true);
  472.         this.customUpdate = true;
  473.     }
  474.  
  475.     public void ChangeBodyFromSetting(bool forceChange = true)
  476.     {
  477.         int? bodyNo = base.bodyNo;
  478.         int? panstNo = this.panstNo;
  479.         int? socksNo = this.socksNo;
  480.         int? shoesNo = this.shoesNo;
  481.         this.ChangeBody(!bodyNo.HasValue ? 0 : bodyNo.Value, !panstNo.HasValue ? 0 : panstNo.Value, !socksNo.HasValue ? 6 : socksNo.Value, !shoesNo.HasValue ? 3 : shoesNo.Value, forceChange);
  482.     }
  483.  
  484.     public void ChangeBustYureState(bool yure, byte lr)
  485.     {
  486.         float w = !yure ? 0f : 1f;
  487.         foreach (DynamicBone_Custom custom in this.GetRefObject(E_REF_NAME.cf_J_Mune00).GetComponents<DynamicBone_Custom>())
  488.         {
  489.             if (((lr == 0) || (lr == 2)) && (string.Compare(custom.comment, "BustL") == 0))
  490.             {
  491.                 custom.SetWeight(w);
  492.             }
  493.             if (((lr == 1) || (lr == 2)) && (string.Compare(custom.comment, "BustR") == 0))
  494.             {
  495.                 custom.SetWeight(w);
  496.             }
  497.         }
  498.     }
  499.  
  500.     public void ChangeCheekAlpha(float alpha)
  501.     {
  502.         GameObject refObject = this.GetRefObject(E_REF_NAME.cf_O_hohoaka);
  503.         if (null != refObject)
  504.         {
  505.             this.cheekAlpha = alpha;
  506.             if ((refObject.renderer != null) && (refObject.renderer.material != null))
  507.             {
  508.                 Color color = refObject.renderer.material.color;
  509.                 color.a = this.cheekAlpha;
  510.                 refObject.renderer.material.color = color;
  511.             }
  512.         }
  513.     }
  514.  
  515.     public bool ChangeCosAcsState(E_ACS_KIND kind, byte state, bool forceChange = false)
  516.     {
  517.         int index = (int) kind;
  518.         if (forceChange || (this.cosAcsState[index] != state))
  519.         {
  520.             this.cosAcsState[index] = new byte?(state);
  521.             if (null != this.objAcs[index])
  522.             {
  523.                 Transform child = this.objAcs[index].transform.GetChild(0);
  524.                 if (null != child)
  525.                 {
  526.                     child.gameObject.SetActive(0 == this.cosAcsState[index].Value);
  527.                 }
  528.             }
  529.         }
  530.         return true;
  531.     }
  532.  
  533.     public bool ChangeCosBottomState(byte state, bool forceChange = false)
  534.     {
  535.         if (forceChange || (this.cosBottomState != state))
  536.         {
  537.             this.cosBottomState = new byte?(state);
  538.             bool[,] flagArray = new bool[,] { { true, true, false, false }, { false, false, true, true }, { false, false, false, false } };
  539.             this.ChangeActive(E_REF_NAME.N_bot_a_d, flagArray[this.cosBottomState.Value, 0]);
  540.             this.ChangeActive(E_REF_NAME.N_bot_b_d, flagArray[this.cosBottomState.Value, 1]);
  541.             this.ChangeActive(E_REF_NAME.N_bot_a_n, flagArray[this.cosBottomState.Value, 2]);
  542.             this.ChangeActive(E_REF_NAME.N_bot_b_n, flagArray[this.cosBottomState.Value, 3]);
  543.             if (this.BodySubInfo.IsTBSet)
  544.             {
  545.                 if (state == 0)
  546.                 {
  547.                     if (this.GetCosTopState() == 2)
  548.                     {
  549.                         this.ChangeCosTopState(0, false);
  550.                     }
  551.                 }
  552.                 else if (state == 1)
  553.                 {
  554.                     if (this.GetCosTopState() == 2)
  555.                     {
  556.                         this.ChangeCosTopState(1, false);
  557.                     }
  558.                 }
  559.                 else
  560.                 {
  561.                     this.ChangeCosTopState(2, false);
  562.                 }
  563.             }
  564.         }
  565.         return true;
  566.     }
  567.  
  568.     public bool ChangeCosBottomType(byte type, bool forceChange = false)
  569.     {
  570.         if (!this.BodySubInfo.Bottom[type])
  571.         {
  572.             for (byte i = 0; i < 2; i = (byte) (i + 1))
  573.             {
  574.                 if (this.BodySubInfo.Bottom[i])
  575.                 {
  576.                     type = i;
  577.                     break;
  578.                 }
  579.             }
  580.         }
  581.         if (forceChange || (this.cosBottomType != type))
  582.         {
  583.             this.cosBottomType = new byte?(type);
  584.             bool[] flagArray1 = new bool[2, 2];
  585.             flagArray1[0, 0] = true;
  586.             flagArray1[1, 1] = true;
  587.             bool[,] flagArray = flagArray1;
  588.             this.ChangeActive(E_REF_NAME.N_bottoms_a, flagArray[this.cosBottomType.Value, 0]);
  589.             this.ChangeActive(E_REF_NAME.N_bottoms_b, flagArray[this.cosBottomType.Value, 1]);
  590.             GameObject refObject = this.GetRefObject(E_REF_NAME.cf_J_sk_top_dam);
  591.             if ((type == 0) && this.BodySubInfo.IsDBSkirt)
  592.             {
  593.                 refObject.SetActive(true);
  594.             }
  595.             else if ((type == 1) && this.BodySubInfo.IsDBZubon)
  596.             {
  597.                 refObject.SetActive(true);
  598.             }
  599.             else
  600.             {
  601.                 refObject.SetActive(false);
  602.             }
  603.         }
  604.         return true;
  605.     }
  606.  
  607.     public bool ChangeCosBuraState(byte state, bool forceChange = false)
  608.     {
  609.         if (forceChange || (this.cosBuraState != state))
  610.         {
  611.             this.cosBuraState = new byte?(state);
  612.             bool[,] flagArray = new bool[,] {
  613.                 true, true, true, false, false, false, false, false, false, true, true, true, false, false, false, false,
  614.                 false, false, false, false
  615.              };
  616.             this.ChangeActive(E_REF_NAME.cf_O_bra_a_d, flagArray[this.cosBuraState.Value, 0]);
  617.             this.ChangeActive(E_REF_NAME.cf_O_bra_b_d, flagArray[this.cosBuraState.Value, 1]);
  618.             this.ChangeActive(E_REF_NAME.cf_O_bra_c_d, flagArray[this.cosBuraState.Value, 2]);
  619.             this.ChangeActive(E_REF_NAME.cf_O_bra_a_n, flagArray[this.cosBuraState.Value, 3]);
  620.             this.ChangeActive(E_REF_NAME.cf_O_bra_b_n, flagArray[this.cosBuraState.Value, 4]);
  621.             this.ChangeActive(E_REF_NAME.cf_O_bra_c_n, flagArray[this.cosBuraState.Value, 5]);
  622.         }
  623.         return true;
  624.     }
  625.  
  626.     public bool ChangeCosOptionsState(int id, byte state, bool forceChange = false)
  627.     {
  628.         if (forceChange || (this.cosOptionsState[id] != state))
  629.         {
  630.             this.cosOptionsState[id] = new byte?(state);
  631.             E_REF_NAME[] e_ref_nameArray = new E_REF_NAME[] { E_REF_NAME.N_option1, E_REF_NAME.N_option2 };
  632.             this.ChangeActive(e_ref_nameArray[id], 0 == this.cosOptionsState[id].Value);
  633.         }
  634.         return true;
  635.     }
  636.  
  637.     public bool ChangeCosPanstState(byte state, bool forceChange = false)
  638.     {
  639.         if (forceChange || (this.cosPanstState != state))
  640.         {
  641.             this.cosPanstState = new byte?(state);
  642.             bool[] flagArray1 = new bool[3, 2];
  643.             flagArray1[0, 0] = true;
  644.             flagArray1[1, 1] = true;
  645.             bool[,] flagArray = flagArray1;
  646.             this.ChangeActive(E_REF_NAME.N_panst_d, flagArray[this.cosPanstState.Value, 0]);
  647.             this.ChangeActive(E_REF_NAME.N_panst_n, flagArray[this.cosPanstState.Value, 1]);
  648.         }
  649.         return true;
  650.     }
  651.  
  652.     public bool ChangeCosPantsState(byte state, bool forceChange = false)
  653.     {
  654.         if (forceChange || (this.cosPantsState != state))
  655.         {
  656.             this.cosPantsState = new byte?(state);
  657.             bool[] flagArray1 = new bool[3, 2];
  658.             flagArray1[0, 0] = true;
  659.             flagArray1[1, 1] = true;
  660.             bool[,] flagArray = flagArray1;
  661.             this.ChangeActive(E_REF_NAME.cf_O_shorts_d, flagArray[this.cosPantsState.Value, 0]);
  662.             this.ChangeActive(E_REF_NAME.cf_O_shorts_n, flagArray[this.cosPantsState.Value, 1]);
  663.         }
  664.         return true;
  665.     }
  666.  
  667.     public bool ChangeCosShoesState(byte state, bool forceChange = false)
  668.     {
  669.         if (forceChange || (this.cosShoesState != state))
  670.         {
  671.             this.cosShoesState = new byte?(state);
  672.             this.ChangeActive(E_REF_NAME.N_cf_shoes, 0 == this.cosShoesState.Value);
  673.         }
  674.         return true;
  675.     }
  676.  
  677.     public bool ChangeCosSocksState(byte state, bool forceChange = false)
  678.     {
  679.         if (forceChange || (this.cosSocksState != state))
  680.         {
  681.             this.cosSocksState = new byte?(state);
  682.             this.ChangeActive(E_REF_NAME.N_cf_socks, 0 == this.cosSocksState.Value);
  683.         }
  684.         return true;
  685.     }
  686.  
  687.     public bool ChangeCosSodeType(byte type, bool forceChange = false)
  688.     {
  689.         if (!this.BodySubInfo.Sode[type])
  690.         {
  691.             for (byte i = 0; i < 3; i = (byte) (i + 1))
  692.             {
  693.                 if (this.BodySubInfo.Sode[i])
  694.                 {
  695.                     type = i;
  696.                     break;
  697.                 }
  698.             }
  699.         }
  700.         if (forceChange || (this.cosSodeType != type))
  701.         {
  702.             this.cosSodeType = new byte?(type);
  703.             bool[] flagArray1 = new bool[3, 3];
  704.             flagArray1[0, 0] = true;
  705.             flagArray1[1, 1] = true;
  706.             flagArray1[2, 2] = true;
  707.             bool[,] flagArray = flagArray1;
  708.             this.ChangeActive(E_REF_NAME.N_sode01, flagArray[this.cosSodeType.Value, 0]);
  709.             this.ChangeActive(E_REF_NAME.N_sode02, flagArray[this.cosSodeType.Value, 1]);
  710.             this.ChangeActive(E_REF_NAME.N_sode03, flagArray[this.cosSodeType.Value, 2]);
  711.         }
  712.         return true;
  713.     }
  714.  
  715.     public bool ChangeCosStateAll(byte state)
  716.     {
  717.         byte[,] buffer = new byte[,] {
  718.             0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  719.             0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  720.             0, 0, 0, 0, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
  721.             1, 1, 1, 1, 1, 1, 0, 0
  722.          };
  723.         this.ChangeCosTopState(buffer[state, 0], false);
  724.         this.ChangeCosBottomState(buffer[state, 1], false);
  725.         this.ChangeCosBuraState(buffer[state, 2], false);
  726.         this.ChangeCosPantsState(buffer[state, 3], false);
  727.         this.ChangeCosPanstState(buffer[state, 4], false);
  728.         this.ChangeCosSocksState(buffer[state, 5], false);
  729.         this.ChangeCosShoesState(buffer[state, 6], false);
  730.         for (int i = 0; i < this.cosAcsState.Length; i++)
  731.         {
  732.             this.ChangeCosAcsState((E_ACS_KIND) i, buffer[state, 7 + i], false);
  733.         }
  734.         for (int j = 0; j < this.cosOptionsState.Length; j++)
  735.         {
  736.             this.ChangeCosOptionsState(j, buffer[state, 0x10 + j], false);
  737.         }
  738.         return true;
  739.     }
  740.  
  741.     public bool ChangeCosTopState(byte state, bool forceChange = false)
  742.     {
  743.         if (forceChange || (this.cosTopState != state))
  744.         {
  745.             this.cosTopState = new byte?(state);
  746.             bool[,] flagArray = new bool[,] {
  747.                 true, true, false, false, false, false, true, false, false, true, true, false, false, true, false, false,
  748.                 false, false, true, true, false, false, false, false
  749.              };
  750.             this.ChangeActive(E_REF_NAME.N_tops_a, flagArray[this.cosTopState.Value, 0]);
  751.             this.ChangeActive(E_REF_NAME.N_bra_a, flagArray[this.cosTopState.Value, 1]);
  752.             this.ChangeActive(E_REF_NAME.N_tops_b, flagArray[this.cosTopState.Value, 2]);
  753.             this.ChangeActive(E_REF_NAME.N_bra_b, flagArray[this.cosTopState.Value, 3]);
  754.             this.ChangeActive(E_REF_NAME.N_tops_c, flagArray[this.cosTopState.Value, 4]);
  755.             this.ChangeActive(E_REF_NAME.N_bra_c, flagArray[this.cosTopState.Value, 5]);
  756.             this.ChangeActive(E_REF_NAME.N_sode, flagArray[this.cosTopState.Value, 6]);
  757.             if (this.BodySubInfo.IsTBSet)
  758.             {
  759.                 if (state == 0)
  760.                 {
  761.                     if (this.GetCosBottomState() == 2)
  762.                     {
  763.                         this.ChangeCosBottomState(0, false);
  764.                     }
  765.                 }
  766.                 else if (state == 1)
  767.                 {
  768.                     if (this.GetCosBottomState() == 2)
  769.                     {
  770.                         this.ChangeCosBottomState(1, false);
  771.                     }
  772.                 }
  773.                 else
  774.                 {
  775.                     this.ChangeCosBottomState(2, false);
  776.                 }
  777.             }
  778.         }
  779.         return true;
  780.     }
  781.  
  782.     public override void ChangeEyeblowOpen(float value)
  783.     {
  784.         if (this.EyebrowCtrl != null)
  785.         {
  786.             this.EyebrowCtrl.OpenMax = Mathf.Clamp(value, 0f, 1f);
  787.         }
  788.     }
  789.  
  790.     public override void ChangeEyeblowPtn(int ptn, bool blend = true)
  791.     {
  792.         if (this.EyebrowCtrl != null)
  793.         {
  794.             this.ptnBsEyeblow = ptn;
  795.             this.EyebrowCtrl.ChangePtn(ptn, blend);
  796.         }
  797.     }
  798.  
  799.     public override void ChangeEyesOpen(float value)
  800.     {
  801.         if (this.EyesCtrl != null)
  802.         {
  803.             this.EyesCtrl.OpenMax = Mathf.Clamp(value, 0f, 1f);
  804.         }
  805.     }
  806.  
  807.     public override void ChangeEyesPtn(int ptn, bool blend = true)
  808.     {
  809.         if (this.EyesCtrl != null)
  810.         {
  811.             this.ptnBsEyes = ptn;
  812.             this.EyesCtrl.ChangePtn(ptn, blend);
  813.         }
  814.     }
  815.  
  816.     public void ChangeHair(int _hairFNo = -1, int _hairBNo = -1, int _hairSNo = -1, int _hairONo = -1, bool forceChange = false)
  817.     {
  818.         if (forceChange)
  819.         {
  820.             if (_hairFNo != -1)
  821.             {
  822.                 this.charCustom.nowCCI.hairFNo = -2;
  823.             }
  824.             if (_hairBNo != -1)
  825.             {
  826.                 this.charCustom.nowCCI.hairBNo = -2;
  827.             }
  828.             if (_hairSNo != -1)
  829.             {
  830.                 this.charCustom.nowCCI.hairSNo = -2;
  831.             }
  832.             if (_hairONo != -1)
  833.             {
  834.                 this.charCustom.nowCCI.hairONo = -2;
  835.             }
  836.         }
  837.         else
  838.         {
  839.             if ((_hairFNo != -1) && (null == this.objHairF))
  840.             {
  841.                 this.charCustom.nowCCI.hairFNo = -2;
  842.             }
  843.             if ((_hairBNo != -1) && (null == this.objHairB))
  844.             {
  845.                 this.charCustom.nowCCI.hairBNo = -2;
  846.             }
  847.             if ((_hairSNo != -1) && (null == this.objHairS))
  848.             {
  849.                 this.charCustom.nowCCI.hairSNo = -2;
  850.             }
  851.             if ((_hairONo != -1) && (null == this.objHairO))
  852.             {
  853.                 this.charCustom.nowCCI.hairONo = -2;
  854.             }
  855.         }
  856.         GameObject refObject = this.GetRefObject(E_REF_NAME.cf_J_Head_s);
  857.         if ((_hairFNo != -1) && (_hairFNo != this.charCustom.nowCCI.hairFNo))
  858.         {
  859.             if (this.objHairF != null)
  860.             {
  861.                 CommonAssist.Destroy(ref this.objHairF);
  862.             }
  863.             Dictionary<int, ListTypeChara> charaObjList = base.listInfo.GetCharaObjList(ListInfo.EInfoType.ELI_F_HairF, true);
  864.             if (!charaObjList.ContainsKey(_hairFNo))
  865.             {
  866.                 _hairFNo = 0;
  867.             }
  868.             this.objHairF = CommonAssist.LoadCloneFromAssetBundle(charaObjList[_hairFNo].ABName, charaObjList[_hairFNo].PName, "cf_hairF", base.objTop);
  869.             if ((null != this.objHairF) && (refObject != null))
  870.             {
  871.                 this.objHairF.transform.parent = refObject.transform;
  872.                 this.objHairF.transform.SetLocalPosition(0f, 0f, 0f);
  873.                 this.objHairF.transform.SetLocalRotation(0f, 0f, 0f);
  874.             }
  875.             this.charCustom.nowCCI.hairFNo = new int?(_hairFNo);
  876.             this.listMeshHairF.Clear();
  877.             this.objHairF.transform.FindLoopPrefix(this.listMeshHairF, "hf");
  878.             this.charCustom.ChangeHairShader(0);
  879.             this.SetDBHairCollision(this.objHairF);
  880.         }
  881.         if ((_hairBNo != -1) && (_hairBNo != this.charCustom.nowCCI.hairBNo))
  882.         {
  883.             if (this.objHairB != null)
  884.             {
  885.                 CommonAssist.Destroy(ref this.objHairB);
  886.             }
  887.             Dictionary<int, ListTypeChara> dictionary2 = base.listInfo.GetCharaObjList(ListInfo.EInfoType.ELI_F_HairB, true);
  888.             if (!dictionary2.ContainsKey(_hairBNo))
  889.             {
  890.                 _hairBNo = 0;
  891.             }
  892.             this.objHairB = CommonAssist.LoadCloneFromAssetBundle(dictionary2[_hairBNo].ABName, dictionary2[_hairBNo].PName, "cf_hairB", base.objTop);
  893.             if ((null != this.objHairB) && (refObject != null))
  894.             {
  895.                 this.objHairB.transform.parent = refObject.transform;
  896.                 this.objHairB.transform.SetLocalPosition(0f, 0f, 0f);
  897.                 this.objHairB.transform.SetLocalRotation(0f, 0f, 0f);
  898.             }
  899.             this.charCustom.nowCCI.hairBNo = new int?(_hairBNo);
  900.             this.listMeshHairB.Clear();
  901.             this.objHairB.transform.FindLoopPrefix(this.listMeshHairB, "hb");
  902.             this.charCustom.ChangeHairShader(1);
  903.             this.SetDBHairCollision(this.objHairB);
  904.         }
  905.         if ((_hairSNo != -1) && (_hairSNo != this.charCustom.nowCCI.hairSNo))
  906.         {
  907.             if (this.objHairS != null)
  908.             {
  909.                 CommonAssist.Destroy(ref this.objHairS);
  910.             }
  911.             Dictionary<int, ListTypeChara> dictionary3 = base.listInfo.GetCharaObjList(ListInfo.EInfoType.ELI_F_HairS, true);
  912.             if (!dictionary3.ContainsKey(_hairSNo))
  913.             {
  914.                 _hairSNo = 0;
  915.             }
  916.             this.objHairS = CommonAssist.LoadCloneFromAssetBundle(dictionary3[_hairSNo].ABName, dictionary3[_hairSNo].PName, "cf_hairS", base.objTop);
  917.             if ((null != this.objHairS) && (refObject != null))
  918.             {
  919.                 this.objHairS.transform.parent = refObject.transform;
  920.                 this.objHairS.transform.SetLocalPosition(0f, 0f, 0f);
  921.                 this.objHairS.transform.SetLocalRotation(0f, 0f, 0f);
  922.             }
  923.             this.charCustom.nowCCI.hairSNo = new int?(_hairSNo);
  924.             this.listMeshHairS.Clear();
  925.             this.objHairS.transform.FindLoopPrefix(this.listMeshHairS, "hs");
  926.             this.charCustom.ChangeHairShader(2);
  927.             this.SetDBHairCollision(this.objHairS);
  928.         }
  929.         if ((_hairONo != -1) && (_hairONo != this.charCustom.nowCCI.hairONo))
  930.         {
  931.             if (this.objHairO != null)
  932.             {
  933.                 CommonAssist.Destroy(ref this.objHairO);
  934.             }
  935.             Dictionary<int, ListTypeChara> dictionary4 = base.listInfo.GetCharaObjList(ListInfo.EInfoType.ELI_F_HairO, true);
  936.             if (!dictionary4.ContainsKey(_hairONo))
  937.             {
  938.                 _hairONo = 0;
  939.             }
  940.             this.objHairO = CommonAssist.LoadCloneFromAssetBundle(dictionary4[_hairONo].ABName, dictionary4[_hairONo].PName, "cf_hairO", base.objTop);
  941.             if ((null != this.objHairO) && (refObject != null))
  942.             {
  943.                 this.objHairO.transform.parent = refObject.transform;
  944.                 this.objHairO.transform.SetLocalPosition(0f, 0f, 0f);
  945.                 this.objHairO.transform.SetLocalRotation(0f, 0f, 0f);
  946.             }
  947.             this.charCustom.nowCCI.hairONo = new int?(_hairONo);
  948.             this.listMeshHairO.Clear();
  949.             this.objHairO.transform.FindLoopPrefix(this.listMeshHairO, "ho");
  950.             this.charCustom.ChangeHairShader(3);
  951.             this.SetDBHairCollision(this.objHairO);
  952.         }
  953.     }
  954.  
  955.     public void ChangeHairFromSetting(bool forceChange = true)
  956.     {
  957.         int[] numArray = new int[4];
  958.         if ((this.charCustom != null) && (this.charCustom.nowCCI != null))
  959.         {
  960.             int? hairFNo = this.charCustom.nowCCI.hairFNo;
  961.             numArray[0] = !hairFNo.HasValue ? 4 : hairFNo.Value;
  962.             int? hairBNo = this.charCustom.nowCCI.hairBNo;
  963.             numArray[1] = !hairBNo.HasValue ? 3 : hairBNo.Value;
  964.             int? hairSNo = this.charCustom.nowCCI.hairSNo;
  965.             numArray[2] = !hairSNo.HasValue ? 0 : hairSNo.Value;
  966.             int? hairONo = this.charCustom.nowCCI.hairONo;
  967.             numArray[3] = !hairONo.HasValue ? 0 : hairONo.Value;
  968.         }
  969.         this.ChangeHair(numArray[0], numArray[1], numArray[2], numArray[3], forceChange);
  970.     }
  971.  
  972.     public void ChangeHead(int _headNo = -1, int _eyelineNo = -1, bool forceChange = false)
  973.     {
  974.         if (forceChange)
  975.         {
  976.             if (_headNo != -1)
  977.             {
  978.                 base.headNo = -2;
  979.             }
  980.             if (_eyelineNo != -1)
  981.             {
  982.                 this.charCustom.nowCCI.eyelineNo = -2;
  983.             }
  984.         }
  985.         else
  986.         {
  987.             if ((_headNo != -1) && (null == base.objHead))
  988.             {
  989.                 base.headNo = -2;
  990.             }
  991.             if ((_eyelineNo != -1) && (null == this.objEyeline))
  992.             {
  993.                 this.charCustom.nowCCI.eyelineNo = -2;
  994.             }
  995.         }
  996.         GameObject refObject = this.GetRefObject(E_REF_NAME.cf_J_Head_s);
  997.         if ((_headNo != -1) && (_headNo != base.headNo))
  998.         {
  999.             if (base.objHead != null)
  1000.             {
  1001.                 this.eyeScaleInfo.Release();
  1002.                 CommonAssist.Destroy(ref this.objHead);
  1003.             }
  1004.             Dictionary<int, ListTypeChara> charaObjList = base.listInfo.GetCharaObjList(ListInfo.EInfoType.ELI_F_Face, true);
  1005.             if (!charaObjList.ContainsKey(_headNo))
  1006.             {
  1007.                 _headNo = 0;
  1008.             }
  1009.             string str = string.Empty;
  1010.             base.objHead = CommonAssist.LoadCloneFromAssetBundle(charaObjList[_headNo].ABName, charaObjList[_headNo].PName, "cf_head", base.objTop);
  1011.             if (null != base.objHead)
  1012.             {
  1013.                 if (refObject != null)
  1014.                 {
  1015.                     base.objHead.transform.parent = refObject.transform;
  1016.                     base.objHead.transform.SetLocalPosition(0f, 0f, 0f);
  1017.                     base.objHead.transform.SetLocalRotation(0f, 0f, 0f);
  1018.                 }
  1019.                 GameObject obj3 = base.objHead.transform.FindLoop("EyeLookControl");
  1020.                 if (obj3 != null)
  1021.                 {
  1022.                     EyeLookCalc component = obj3.GetComponent<EyeLookCalc>();
  1023.                     if (component != null)
  1024.                     {
  1025.                         component.Init();
  1026.                     }
  1027.                     this.eyeLookCtrl = obj3.GetComponent<EyeLookController>();
  1028.                     if (this.eyeLookCtrl != null)
  1029.                     {
  1030.                         this.ChangeLookEyesTarget(this.GetLookTargetE(), null, 1f);
  1031.                     }
  1032.                 }
  1033.                 this.fbsCtrlHead = base.objHead.GetComponent<FaceBlendShape>();
  1034.                 if (null != this.fbsCtrlHead)
  1035.                 {
  1036.                     this.fbsCtrlHead.SetBlinkControlEx(this.blinkCtrl);
  1037.                     this.EyebrowCtrl = this.fbsCtrlHead.EyebrowCtrl;
  1038.                     this.MouthCtrl = this.fbsCtrlHead.MouthCtrl;
  1039.                 }
  1040.                 this.eyeScaleInfo.LoadUVData(charaObjList[_headNo].ABName, this.female_dir + str + charaObjList[_headNo].PName + "_UV");
  1041.                 this.eyeScaleInfo.InitTargetObj(base.objHead);
  1042.             }
  1043.             base.headNo = new int?(_headNo);
  1044.             this.siruLv[0] = 0;
  1045.         }
  1046.         if ((_eyelineNo != -1) && (_eyelineNo != this.charCustom.nowCCI.eyelineNo))
  1047.         {
  1048.             if (this.objEyeline != null)
  1049.             {
  1050.                 CommonAssist.Destroy(ref this.objEyeline);
  1051.             }
  1052.             Dictionary<int, ListTypeChara> dictionary2 = base.listInfo.GetCharaObjList(ListInfo.EInfoType.ELI_F_Eyeline, true);
  1053.             if (!dictionary2.ContainsKey(_eyelineNo))
  1054.             {
  1055.                 _eyelineNo = 0;
  1056.             }
  1057.             this.objEyeline = CommonAssist.LoadCloneFromAssetBundle(dictionary2[_eyelineNo].ABName, dictionary2[_eyelineNo].PName, "cf_eyeline", base.objTop);
  1058.             if (null != this.objEyeline)
  1059.             {
  1060.                 if (refObject != null)
  1061.                 {
  1062.                     this.objEyeline.transform.parent = refObject.transform;
  1063.                     this.objEyeline.transform.SetLocalPosition(0f, 0f, 0f);
  1064.                     this.objEyeline.transform.SetLocalRotation(0f, 0f, 0f);
  1065.                 }
  1066.                 this.fbsCtrlELine = this.objEyeline.GetComponent<FaceBlendShape>();
  1067.                 if (null != this.fbsCtrlELine)
  1068.                 {
  1069.                     this.fbsCtrlELine.SetBlinkControlEx(this.blinkCtrl);
  1070.                     this.EyesCtrl = this.fbsCtrlELine.EyesCtrl;
  1071.                 }
  1072.             }
  1073.             this.charCustom.nowCCI.eyelineNo = new int?(_eyelineNo);
  1074.         }
  1075.         this.InitRefObject(4);
  1076.         this.GetMeshInFaceFromTag();
  1077.         this.GetMeshInEyelineFromTag();
  1078.         byte? tongueType = this.tongueType;
  1079.         this.ChangeTongueKind(!tongueType.HasValue ? ((byte) 0) : tongueType.Value, true);
  1080.         this.ChangeCheekAlpha(this.cheekAlpha);
  1081.         int? skinTexColor = this.charCustom.nowCCI.skinTexColor;
  1082.         this.charCustom.ChangeTexSkin(!skinTexColor.HasValue ? 0 : skinTexColor.Value, true);
  1083.         int? eyeblowTexType = this.charCustom.nowCCI.eyeblowTexType;
  1084.         this.charCustom.ChangeTexEyeBlow(!eyeblowTexType.HasValue ? 0 : eyeblowTexType.Value, true);
  1085.         this.charCustom.ChangeEyeblowShader(this.charCustom.nowCCI.eyeblowColor);
  1086.         int? eyeTexType = this.charCustom.nowCCI.eyeTexType;
  1087.         this.charCustom.ChangeTexEye(!eyeTexType.HasValue ? 0 : eyeTexType.Value, true);
  1088.         for (int i = 0; i < 2; i++)
  1089.         {
  1090.             this.charCustom.ChangeEyeShader((byte) i, this.charCustom.nowCCI.eyeColor[i]);
  1091.         }
  1092.         int? eyeHiTexType = this.charCustom.nowCCI.eyeHiTexType;
  1093.         this.charCustom.ChangeTexEyeHi(!eyeHiTexType.HasValue ? 0 : eyeHiTexType.Value, true);
  1094.         this.charCustom.ChangeLipShader(this.charCustom.nowCCI.lipColor, this.charCustom.nowCCI.lipAlpha);
  1095.         SystemEtcetera.EtcData etcData = Manager.Config.EtcData;
  1096.         this.charCustom.ChangeTexSkinToon(etcData.data[4], true);
  1097.         this.customUpdate = true;
  1098.         if (((null != this.objEyeline) && (null != base.objHead)) && (null != this.fbsCtrlELine))
  1099.         {
  1100.             this.fbsCtrlELine.EyeLookController = this.eyeLookCtrl;
  1101.         }
  1102.     }
  1103.  
  1104.     public void ChangeHeadFromSetting(bool forceChange = true)
  1105.     {
  1106.         int num = 0;
  1107.         if ((this.charCustom != null) && (this.charCustom.nowCCI != null))
  1108.         {
  1109.             int? eyelineNo = this.charCustom.nowCCI.eyelineNo;
  1110.             num = !eyelineNo.HasValue ? 0 : eyelineNo.Value;
  1111.         }
  1112.         int? headNo = base.headNo;
  1113.         this.ChangeHead(!headNo.HasValue ? 0 : headNo.Value, num, forceChange);
  1114.     }
  1115.  
  1116.     public override void ChangeLookEyesPtn(int ptn, bool ForceChange = false)
  1117.     {
  1118.         if (null != this.eyeLookCtrl)
  1119.         {
  1120.             this.eyeLookCtrl.ptnNo = ptn;
  1121.         }
  1122.     }
  1123.  
  1124.     public override void ChangeLookEyesTarget(int targetNo, GameObject target = null, float rate = 1f)
  1125.     {
  1126.         if (null != this.eyeLookCtrl)
  1127.         {
  1128.             this.lookTargetE = targetNo;
  1129.             if (targetNo == 0)
  1130.             {
  1131.                 if (Camera.main != null)
  1132.                 {
  1133.                     this.eyeLookCtrl.target = Camera.main.transform;
  1134.                 }
  1135.                 else
  1136.                 {
  1137.                     this.eyeLookCtrl.target = null;
  1138.                 }
  1139.             }
  1140.             else
  1141.             {
  1142.                 this.eyeLookCtrl.target = (null != target) ? target.transform : null;
  1143.             }
  1144.         }
  1145.     }
  1146.  
  1147.     public override void ChangeLookNeckPtn(int ptn, bool ForceChange = false)
  1148.     {
  1149.         if (null != this.neckLookCtrl)
  1150.         {
  1151.             this.neckLookCtrl.ptnNo = ptn;
  1152.         }
  1153.     }
  1154.  
  1155.     public override void ChangeLookNeckTarget(int targetNo, GameObject target = null, float rate = 1f)
  1156.     {
  1157.         if (null != this.neckLookCtrl)
  1158.         {
  1159.             this.lookTargetN = targetNo;
  1160.             if (targetNo == 0)
  1161.             {
  1162.                 if (Camera.main != null)
  1163.                 {
  1164.                     this.neckLookCtrl.target = Camera.main.transform;
  1165.                 }
  1166.                 else
  1167.                 {
  1168.                     this.neckLookCtrl.target = null;
  1169.                 }
  1170.             }
  1171.             else
  1172.             {
  1173.                 this.neckLookCtrl.target = (null != target) ? target.transform : null;
  1174.             }
  1175.         }
  1176.     }
  1177.  
  1178.     public override void ChangeMouthOpen(float value)
  1179.     {
  1180.         if (this.MouthCtrl != null)
  1181.         {
  1182.             this.MouthCtrl.OpenMax = Mathf.Clamp(value, 0f, 1f);
  1183.         }
  1184.     }
  1185.  
  1186.     public override void ChangeMouthPtn(int ptn, bool blend = true, bool limit = true)
  1187.     {
  1188.         if (this.MouthCtrl != null)
  1189.         {
  1190.             this.ptnBsMouth = ptn;
  1191.             this.MouthCtrl.ChangePtn(ptn, blend);
  1192.             if (limit)
  1193.             {
  1194.                 if ((ptn == 13) || (ptn == 14))
  1195.                 {
  1196.                     this.ChangeTongueKind(1, false);
  1197.                 }
  1198.                 else
  1199.                 {
  1200.                     this.ChangeTongueKind(0, false);
  1201.                 }
  1202.             }
  1203.         }
  1204.     }
  1205.  
  1206.     public bool ChangeTongueKind(byte type, bool forceChange = false)
  1207.     {
  1208.         if (forceChange || (this.tongueType != type))
  1209.         {
  1210.             if ((null == this.GetRefObject(E_REF_NAME.cf_O_sitamof)) || (null == this.GetRefObject(E_REF_NAME.cf_O_tang)))
  1211.             {
  1212.                 return false;
  1213.             }
  1214.             this.tongueType = new byte?(type);
  1215.             bool[] flagArray1 = new bool[2, 2];
  1216.             flagArray1[0, 0] = true;
  1217.             flagArray1[1, 1] = true;
  1218.             bool[,] flagArray = flagArray1;
  1219.             this.ChangeActive(E_REF_NAME.cf_O_sitamof, flagArray[this.tongueType.Value, 0]);
  1220.             this.ChangeActive(E_REF_NAME.cf_O_tang, flagArray[this.tongueType.Value, 1]);
  1221.         }
  1222.         return true;
  1223.     }
  1224.  
  1225.     public void CShadowProc()
  1226.     {
  1227.         GameObject[] objShadowTarg = new GameObject[] { this.GetRefObject(E_REF_NAME.cf_J_ArmUp00_L), this.GetRefObject(E_REF_NAME.cf_J_ArmUp00_R), this.GetRefObject(E_REF_NAME.cf_J_LegUp02_L), this.GetRefObject(E_REF_NAME.cf_J_LegUp02_R), this.GetRefObject(E_REF_NAME.cf_J_Hips) };
  1228.         base.CShadowProcBase(objShadowTarg);
  1229.     }
  1230.  
  1231.     public int GetAcsNo(E_ACS_KIND kind)
  1232.     {
  1233.         int? nullable = this.acsNo[(int) kind];
  1234.         return (!nullable.HasValue ? 0 : nullable.Value);
  1235.     }
  1236.  
  1237.     public bool GetBlinkFlag()
  1238.     {
  1239.         return ((this.blinkCtrl != null) && (this.blinkCtrl.GetFixedFlags() == 0));
  1240.     }
  1241.  
  1242.     public int GetCharaNo()
  1243.     {
  1244.         return this.charaNo;
  1245.     }
  1246.  
  1247.     public float GetCheekAlpha()
  1248.     {
  1249.         return this.cheekAlpha;
  1250.     }
  1251.  
  1252.     public byte GetCosAcsState(E_ACS_KIND kind)
  1253.     {
  1254.         byte? nullable = this.cosAcsState[(int) kind];
  1255.         return (!nullable.HasValue ? ((byte) 0) : nullable.Value);
  1256.     }
  1257.  
  1258.     public byte GetCosBottomState()
  1259.     {
  1260.         byte? cosBottomState = this.cosBottomState;
  1261.         return (!cosBottomState.HasValue ? ((byte) 0) : cosBottomState.Value);
  1262.     }
  1263.  
  1264.     public byte GetCosBottomType()
  1265.     {
  1266.         byte? cosBottomType = this.cosBottomType;
  1267.         return (!cosBottomType.HasValue ? ((byte) 0) : cosBottomType.Value);
  1268.     }
  1269.  
  1270.     public byte GetCosBuraState()
  1271.     {
  1272.         byte? cosBuraState = this.cosBuraState;
  1273.         return (!cosBuraState.HasValue ? ((byte) 0) : cosBuraState.Value);
  1274.     }
  1275.  
  1276.     public CosCustom GetCosCustomInstance()
  1277.     {
  1278.         return this.cosCustom;
  1279.     }
  1280.  
  1281.     public byte GetCosOptionState(int id)
  1282.     {
  1283.         byte? nullable = this.cosOptionsState[id];
  1284.         return (!nullable.HasValue ? ((byte) 0) : nullable.Value);
  1285.     }
  1286.  
  1287.     public byte GetCosPanstState()
  1288.     {
  1289.         byte? cosPanstState = this.cosPanstState;
  1290.         return (!cosPanstState.HasValue ? ((byte) 0) : cosPanstState.Value);
  1291.     }
  1292.  
  1293.     public byte GetCosPantsState()
  1294.     {
  1295.         byte? cosPantsState = this.cosPantsState;
  1296.         return (!cosPantsState.HasValue ? ((byte) 0) : cosPantsState.Value);
  1297.     }
  1298.  
  1299.     public byte GetCosShoesState()
  1300.     {
  1301.         byte? cosShoesState = this.cosShoesState;
  1302.         return (!cosShoesState.HasValue ? ((byte) 0) : cosShoesState.Value);
  1303.     }
  1304.  
  1305.     public byte GetCosSocksState()
  1306.     {
  1307.         byte? cosSocksState = this.cosSocksState;
  1308.         return (!cosSocksState.HasValue ? ((byte) 0) : cosSocksState.Value);
  1309.     }
  1310.  
  1311.     public byte GetCosSodeType()
  1312.     {
  1313.         byte? cosSodeType = this.cosSodeType;
  1314.         return (!cosSodeType.HasValue ? ((byte) 0) : cosSodeType.Value);
  1315.     }
  1316.  
  1317.     public byte GetCosTopState()
  1318.     {
  1319.         byte? cosTopState = this.cosTopState;
  1320.         return (!cosTopState.HasValue ? ((byte) 0) : cosTopState.Value);
  1321.     }
  1322.  
  1323.     public CharCustom GetCustomInstance()
  1324.     {
  1325.         return this.charCustom;
  1326.     }
  1327.  
  1328.     public FBSCtrlEyebrow GetEyeBlowCtrl()
  1329.     {
  1330.         return this.EyebrowCtrl;
  1331.     }
  1332.  
  1333.     public int GetEyeblowPtn()
  1334.     {
  1335.         return this.ptnBsEyeblow;
  1336.     }
  1337.  
  1338.     public FBSCtrlEyes GetEyesCtrl()
  1339.     {
  1340.         return this.EyesCtrl;
  1341.     }
  1342.  
  1343.     public bool GetEyesHi()
  1344.     {
  1345.         return this.eyesHi;
  1346.     }
  1347.  
  1348.     public int GetEyesPtn()
  1349.     {
  1350.         return this.ptnBsEyes;
  1351.     }
  1352.  
  1353.     public List<GameObject> GetListMeshHairB()
  1354.     {
  1355.         return this.listMeshHairB;
  1356.     }
  1357.  
  1358.     public List<GameObject> GetListMeshHairF()
  1359.     {
  1360.         return this.listMeshHairF;
  1361.     }
  1362.  
  1363.     public List<GameObject> GetListMeshHairO()
  1364.     {
  1365.         return this.listMeshHairO;
  1366.     }
  1367.  
  1368.     public List<GameObject> GetListMeshHairS()
  1369.     {
  1370.         return this.listMeshHairS;
  1371.     }
  1372.  
  1373.     public List<GameObject> GetListTagColHair()
  1374.     {
  1375.         return this.listTagColHair;
  1376.     }
  1377.  
  1378.     public List<GameObject> GetListTagEyeblow()
  1379.     {
  1380.         return this.listTagEyeblow;
  1381.     }
  1382.  
  1383.     public List<GameObject> GetListTagEyeHi()
  1384.     {
  1385.         return this.listTagEyeHi;
  1386.     }
  1387.  
  1388.     public List<GameObject> GetListTagEyeL()
  1389.     {
  1390.         return this.listTagEyeL;
  1391.     }
  1392.  
  1393.     public List<GameObject> GetListTagEyeline()
  1394.     {
  1395.         return this.listTagEyeline;
  1396.     }
  1397.  
  1398.     public List<GameObject> GetListTagEyeR()
  1399.     {
  1400.         return this.listTagEyeR;
  1401.     }
  1402.  
  1403.     public List<GameObject> GetListTagNail()
  1404.     {
  1405.         return this.listTagNail;
  1406.     }
  1407.  
  1408.     public List<GameObject> GetListTagNip()
  1409.     {
  1410.         return this.listTagNip;
  1411.     }
  1412.  
  1413.     public List<GameObject> GetListTagSkinB()
  1414.     {
  1415.         return this.listTagSkinB;
  1416.     }
  1417.  
  1418.     public List<GameObject> GetListTagSkinE()
  1419.     {
  1420.         return this.listTagSkinE;
  1421.     }
  1422.  
  1423.     public List<GameObject> GetListTagSkinF()
  1424.     {
  1425.         return this.listTagSkinF;
  1426.     }
  1427.  
  1428.     public List<GameObject> GetListTagUHair()
  1429.     {
  1430.         return this.listTagUHair;
  1431.     }
  1432.  
  1433.     public int GetLookEyesPtn()
  1434.     {
  1435.         if (null == this.eyeLookCtrl)
  1436.         {
  1437.             return 0;
  1438.         }
  1439.         return this.eyeLookCtrl.ptnNo;
  1440.     }
  1441.  
  1442.     public int GetLookNeckPtn()
  1443.     {
  1444.         if (null == this.neckLookCtrl)
  1445.         {
  1446.             return 0;
  1447.         }
  1448.         return this.neckLookCtrl.ptnNo;
  1449.     }
  1450.  
  1451.     public int GetLookTargetE()
  1452.     {
  1453.         return this.lookTargetE;
  1454.     }
  1455.  
  1456.     public int GetLookTargetN()
  1457.     {
  1458.         return this.lookTargetN;
  1459.     }
  1460.  
  1461.     public void GetMeshInBodyFromTag()
  1462.     {
  1463.         this.listTagSkinB.Clear();
  1464.         this.listTagNip.Clear();
  1465.         this.listTagUHair.Clear();
  1466.         this.listTagNail.Clear();
  1467.         if (base.objBody != null)
  1468.         {
  1469.             base.objBody.transform.FindLoopTag(this.listTagSkinB, "TexSkinBody");
  1470.             base.objBody.transform.FindLoopTag(this.listTagNip, "TexNip");
  1471.             base.objBody.transform.FindLoopTag(this.listTagUHair, "TexUnderHair");
  1472.             base.objBody.transform.FindLoopTag(this.listTagNail, "TexNail");
  1473.         }
  1474.     }
  1475.  
  1476.     public void GetMeshInEyelineFromTag()
  1477.     {
  1478.         this.listTagEyeline.Clear();
  1479.         this.listTagSkinE.Clear();
  1480.         if (this.objEyeline != null)
  1481.         {
  1482.             this.objEyeline.transform.FindLoopTag(this.listTagEyeline, "TexEyeline");
  1483.             this.objEyeline.transform.FindLoopTag(this.listTagSkinE, "TexSkinEyeline");
  1484.         }
  1485.     }
  1486.  
  1487.     public void GetMeshInFaceFromTag()
  1488.     {
  1489.         this.listTagEyeblow.Clear();
  1490.         this.listTagEyeL.Clear();
  1491.         this.listTagEyeR.Clear();
  1492.         this.listTagEyeHi.Clear();
  1493.         this.listTagSkinF.Clear();
  1494.         if (base.objHead != null)
  1495.         {
  1496.             base.objHead.transform.FindLoopTag(this.listTagEyeblow, "TexEyeblow");
  1497.             base.objHead.transform.FindLoopTag(this.listTagEyeL, "TexEyeL");
  1498.             base.objHead.transform.FindLoopTag(this.listTagEyeR, "TexEyeR");
  1499.             base.objHead.transform.FindLoopTag(this.listTagEyeHi, "TexEyeHi");
  1500.             base.objHead.transform.FindLoopTag(this.listTagSkinF, "TexSkinFace");
  1501.         }
  1502.     }
  1503.  
  1504.     public FBSCtrlMouth GetMouthCtrl()
  1505.     {
  1506.         return this.MouthCtrl;
  1507.     }
  1508.  
  1509.     public int GetMouthPtn()
  1510.     {
  1511.         return this.ptnBsMouth;
  1512.     }
  1513.  
  1514.     public Quaternion GetNeckFixAngle()
  1515.     {
  1516.         if (null == this.neckLookCtrl)
  1517.         {
  1518.             return new Quaternion(0f, 0f, 0f, 1f);
  1519.         }
  1520.         return this.neckLookCtrl.neckLookScript.fixAngle;
  1521.     }
  1522.  
  1523.     public int GetPanstNo()
  1524.     {
  1525.         int? panstNo = this.panstNo;
  1526.         return (!panstNo.HasValue ? 0 : panstNo.Value);
  1527.     }
  1528.  
  1529.     public GameObject GetRefObject(E_REF_NAME nameID)
  1530.     {
  1531.         if (!this.dictRefObj.ContainsKey(nameID))
  1532.         {
  1533.             return null;
  1534.         }
  1535.         return this.dictRefObj[nameID];
  1536.     }
  1537.  
  1538.     public int GetShoesNo()
  1539.     {
  1540.         int? shoesNo = this.shoesNo;
  1541.         return (!shoesNo.HasValue ? 0 : shoesNo.Value);
  1542.     }
  1543.  
  1544.     public int GetSocksNo()
  1545.     {
  1546.         int? socksNo = this.socksNo;
  1547.         return (!socksNo.HasValue ? 0 : socksNo.Value);
  1548.     }
  1549.  
  1550.     public FemaleHStatus GetStatusInstance()
  1551.     {
  1552.         return this.status;
  1553.     }
  1554.  
  1555.     public byte GetTongueKind()
  1556.     {
  1557.         byte? tongueType = this.tongueType;
  1558.         return (!tongueType.HasValue ? ((byte) 0) : tongueType.Value);
  1559.     }
  1560.  
  1561.     public override void Init(ListInfo _listInfo, GameObject parent, string topName, int id, string assetPath, string resourcesDir, string loadfilename = "", bool rand = false, bool studio = false)
  1562.     {
  1563.         this.charCustom = new CharCustom();
  1564.         this.charCustom.Init(this, _listInfo);
  1565.         this.cosCustom = new CosCustom();
  1566.         this.cosCustom.Init(this, _listInfo);
  1567.         base.objTop = new GameObject(topName);
  1568.         base.objTop.transform.parent = parent.transform;
  1569.         this.status = base.objTop.AddComponent<FemaleHStatus>();
  1570.         base.listInfo = _listInfo;
  1571.         base.idNo = id;
  1572.         if (rand)
  1573.         {
  1574.             this.cosCustom.RandCosAll();
  1575.             this.charCustom.RandCustomAll(false, string.Empty);
  1576.         }
  1577.         else if (string.Compare(string.Empty, loadfilename) != 0)
  1578.         {
  1579.             if ((string.Compare(string.Empty, assetPath) == 0) || (string.Compare(string.Empty, resourcesDir) == 0))
  1580.             {
  1581.                 this.LoadCharaData(loadfilename, 0);
  1582.             }
  1583.             else
  1584.             {
  1585.                 char[] separator = new char[] { '_' };
  1586.                 string[] strArray = loadfilename.Split(separator);
  1587.                 string filename = string.Empty;
  1588.                 string key = strArray[0];
  1589.                 if (key != null)
  1590.                 {
  1591.                     int num;
  1592.                     if (<>f__switch$map6 == null)
  1593.                     {
  1594.                         Dictionary<string, int> dictionary = new Dictionary<string, int>(5);
  1595.                         dictionary.Add("kyoka", 0);
  1596.                         dictionary.Add("jyujyu", 1);
  1597.                         dictionary.Add("azusa", 2);
  1598.                         dictionary.Add("ayaka", 3);
  1599.                         dictionary.Add("sizuka", 4);
  1600.                         <>f__switch$map6 = dictionary;
  1601.                     }
  1602.                     if (<>f__switch$map6.TryGetValue(key, out num))
  1603.                     {
  1604.                         switch (num)
  1605.                         {
  1606.                             case 0:
  1607.                                 filename = "IbukiKyoka.png";
  1608.                                 break;
  1609.  
  1610.                             case 1:
  1611.                                 filename = "AkihaJyujyu.png";
  1612.                                 break;
  1613.  
  1614.                             case 2:
  1615.                                 filename = "SaekiAzusa.png";
  1616.                                 break;
  1617.  
  1618.                             case 3:
  1619.                                 filename = "MayuzumiAyaka.png";
  1620.                                 break;
  1621.  
  1622.                             case 4:
  1623.                                 filename = "TsukuyomiSizuka.png";
  1624.                                 break;
  1625.                         }
  1626.                     }
  1627.                 }
  1628.                 if (!this.LoadCharaData(filename, 0))
  1629.                 {
  1630.                 }
  1631.                 this.cosCustom.LoadCosFavorite(loadfilename, assetPath, resourcesDir, 0);
  1632.             }
  1633.         }
  1634.         string file = !studio ? "p_cf_joint" : "p_cf_joint_studio";
  1635.         if (studio)
  1636.         {
  1637.             base.objBone = CommonAssist.LoadCloneFromAssetBundle("chara/cf_base_studio.unity3d", file, "cf_base", base.objTop);
  1638.         }
  1639.         else
  1640.         {
  1641.             base.objBone = CommonAssist.LoadCloneFromAssetBundle("chara/cf_base.unity3d", file, "cf_base", base.objTop);
  1642.         }
  1643.         this.InitRefObject(1);
  1644.         if (base.objBone != null)
  1645.         {
  1646.             base.aaWeights.CreateBoneList(base.objBone, "cf_J");
  1647.             base.GetShadowObj();
  1648.             GameObject refObject = this.GetRefObject(E_REF_NAME.cf_J_Neck);
  1649.             if (refObject != null)
  1650.             {
  1651.                 this.neckLookCtrl = refObject.GetComponent<NeckLookController>();
  1652.                 if (this.neckLookCtrl != null)
  1653.                 {
  1654.                     this.ChangeLookNeckTarget(this.GetLookTargetN(), null, 1f);
  1655.                 }
  1656.             }
  1657.             this.listTagColHair.Clear();
  1658.             base.objBone.transform.FindLoopTag(this.listTagColHair, "ColHair");
  1659.         }
  1660.         this.ChangeBodyFromSetting(true);
  1661.         this.ChangeHeadFromSetting(true);
  1662.         this.ChangeHairFromSetting(true);
  1663.         this.ChangeAccessoryFromSetting(true);
  1664.         this.ChangeLookEyesTarget(0, null, 1f);
  1665.         this.ChangeLookEyesPtn(1, false);
  1666.         this.ChangeLookNeckTarget(0, null, 1f);
  1667.         this.ChangeLookNeckPtn(1, false);
  1668.     }
  1669.  
  1670.     public override void InitRefObject(int flags)
  1671.     {
  1672.         if ((flags & 1) != 0)
  1673.         {
  1674.             this.dictRefObj[E_REF_NAME.cf_J_Head_s] = base.objBone.transform.FindLoop(E_REF_NAME.cf_J_Head_s.ToString());
  1675.             this.dictRefObj[E_REF_NAME.NP_cf_acs_back] = base.objBone.transform.FindLoop(E_REF_NAME.NP_cf_acs_back.ToString());
  1676.             this.dictRefObj[E_REF_NAME.NP_cf_acs_waist] = base.objBone.transform.FindLoop(E_REF_NAME.NP_cf_acs_waist.ToString());
  1677.             this.dictRefObj[E_REF_NAME.NP_cf_acs_wrist_l] = base.objBone.transform.FindLoop(E_REF_NAME.NP_cf_acs_wrist_l.ToString());
  1678.             this.dictRefObj[E_REF_NAME.NP_cf_acs_wrist_r] = base.objBone.transform.FindLoop(E_REF_NAME.NP_cf_acs_wrist_r.ToString());
  1679.             this.dictRefObj[E_REF_NAME.NP_cf_acs_neck] = base.objBone.transform.FindLoop(E_REF_NAME.NP_cf_acs_neck.ToString());
  1680.             this.dictRefObj[E_REF_NAME.cf_J_Mune_Nip02_s_L] = base.objBone.transform.FindLoop(E_REF_NAME.cf_J_Mune_Nip02_s_L.ToString());
  1681.             this.dictRefObj[E_REF_NAME.cf_J_Mune_Nip02_s_R] = base.objBone.transform.FindLoop(E_REF_NAME.cf_J_Mune_Nip02_s_R.ToString());
  1682.             this.dictRefObj[E_REF_NAME.cf_J_sk_top_dam] = base.objBone.transform.FindLoop(E_REF_NAME.cf_J_sk_top_dam.ToString());
  1683.             this.dictRefObj[E_REF_NAME.cf_J_ArmUp00_L] = base.objBone.transform.FindLoop(E_REF_NAME.cf_J_ArmUp00_L.ToString());
  1684.             this.dictRefObj[E_REF_NAME.cf_J_ArmUp00_R] = base.objBone.transform.FindLoop(E_REF_NAME.cf_J_ArmUp00_R.ToString());
  1685.             this.dictRefObj[E_REF_NAME.cf_J_LegUp02_L] = base.objBone.transform.FindLoop(E_REF_NAME.cf_J_LegUp02_L.ToString());
  1686.             this.dictRefObj[E_REF_NAME.cf_J_LegUp02_R] = base.objBone.transform.FindLoop(E_REF_NAME.cf_J_LegUp02_R.ToString());
  1687.             this.dictRefObj[E_REF_NAME.cf_J_Hips] = base.objBone.transform.FindLoop(E_REF_NAME.cf_J_Hips.ToString());
  1688.             this.dictRefObj[E_REF_NAME.cf_J_Mune00] = base.objBone.transform.FindLoop(E_REF_NAME.cf_J_Mune00.ToString());
  1689.             this.dictRefObj[E_REF_NAME.cf_J_Neck] = base.objBone.transform.FindLoop(E_REF_NAME.cf_J_Neck.ToString());
  1690.         }
  1691.         if ((flags & 2) != 0)
  1692.         {
  1693.             this.dictRefObj[E_REF_NAME.N_bottoms_a] = base.objBody.transform.FindLoop(E_REF_NAME.N_bottoms_a.ToString());
  1694.             this.dictRefObj[E_REF_NAME.N_bottoms_b] = base.objBody.transform.FindLoop(E_REF_NAME.N_bottoms_b.ToString());
  1695.             this.dictRefObj[E_REF_NAME.N_tops_a] = base.objBody.transform.FindLoop(E_REF_NAME.N_tops_a.ToString());
  1696.             this.dictRefObj[E_REF_NAME.N_tops_b] = base.objBody.transform.FindLoop(E_REF_NAME.N_tops_b.ToString());
  1697.             this.dictRefObj[E_REF_NAME.N_tops_c] = base.objBody.transform.FindLoop(E_REF_NAME.N_tops_c.ToString());
  1698.             this.dictRefObj[E_REF_NAME.N_bot_a_d] = base.objBody.transform.FindLoop(E_REF_NAME.N_bot_a_d.ToString());
  1699.             this.dictRefObj[E_REF_NAME.N_bot_a_n] = base.objBody.transform.FindLoop(E_REF_NAME.N_bot_a_n.ToString());
  1700.             this.dictRefObj[E_REF_NAME.N_bot_b_d] = base.objBody.transform.FindLoop(E_REF_NAME.N_bot_b_d.ToString());
  1701.             this.dictRefObj[E_REF_NAME.N_bot_b_n] = base.objBody.transform.FindLoop(E_REF_NAME.N_bot_b_n.ToString());
  1702.             this.dictRefObj[E_REF_NAME.N_sode] = base.objBody.transform.FindLoop(E_REF_NAME.N_sode.ToString());
  1703.             this.dictRefObj[E_REF_NAME.N_sode01] = base.objBody.transform.FindLoop(E_REF_NAME.N_sode01.ToString());
  1704.             this.dictRefObj[E_REF_NAME.N_sode02] = base.objBody.transform.FindLoop(E_REF_NAME.N_sode02.ToString());
  1705.             this.dictRefObj[E_REF_NAME.N_sode03] = base.objBody.transform.FindLoop(E_REF_NAME.N_sode03.ToString());
  1706.             this.dictRefObj[E_REF_NAME.N_bra_a] = base.objBody.transform.FindLoop(E_REF_NAME.N_bra_a.ToString());
  1707.             this.dictRefObj[E_REF_NAME.cf_O_bra_a_d] = base.objBody.transform.FindLoop(E_REF_NAME.cf_O_bra_a_d.ToString());
  1708.             this.dictRefObj[E_REF_NAME.cf_O_bra_a_n] = base.objBody.transform.FindLoop(E_REF_NAME.cf_O_bra_a_n.ToString());
  1709.             this.dictRefObj[E_REF_NAME.N_bra_b] = base.objBody.transform.FindLoop(E_REF_NAME.N_bra_b.ToString());
  1710.             this.dictRefObj[E_REF_NAME.cf_O_bra_b_d] = base.objBody.transform.FindLoop(E_REF_NAME.cf_O_bra_b_d.ToString());
  1711.             this.dictRefObj[E_REF_NAME.cf_O_bra_b_n] = base.objBody.transform.FindLoop(E_REF_NAME.cf_O_bra_b_n.ToString());
  1712.             this.dictRefObj[E_REF_NAME.N_bra_c] = base.objBody.transform.FindLoop(E_REF_NAME.N_bra_c.ToString());
  1713.             this.dictRefObj[E_REF_NAME.cf_O_bra_c_d] = base.objBody.transform.FindLoop(E_REF_NAME.cf_O_bra_c_d.ToString());
  1714.             this.dictRefObj[E_REF_NAME.cf_O_bra_c_n] = base.objBody.transform.FindLoop(E_REF_NAME.cf_O_bra_c_n.ToString());
  1715.             this.dictRefObj[E_REF_NAME.N_shorts] = base.objBody.transform.FindLoop(E_REF_NAME.N_shorts.ToString());
  1716.             this.dictRefObj[E_REF_NAME.cf_O_shorts_d] = base.objBody.transform.FindLoop(E_REF_NAME.cf_O_shorts_d.ToString());
  1717.             this.dictRefObj[E_REF_NAME.cf_O_shorts_n] = base.objBody.transform.FindLoop(E_REF_NAME.cf_O_shorts_n.ToString());
  1718.             this.dictRefObj[E_REF_NAME.N_option1] = base.objBody.transform.FindLoop(E_REF_NAME.N_option1.ToString());
  1719.             this.dictRefObj[E_REF_NAME.N_option2] = base.objBody.transform.FindLoop(E_REF_NAME.N_option2.ToString());
  1720.             this.dictRefObj[E_REF_NAME.cf_O_tang] = base.objBody.transform.FindLoop(E_REF_NAME.cf_O_tang.ToString());
  1721.         }
  1722.         if ((flags & 4) != 0)
  1723.         {
  1724.             this.dictRefObj[E_REF_NAME.cf_O_hohoaka] = base.objHead.transform.FindLoop(E_REF_NAME.cf_O_hohoaka.ToString());
  1725.             this.dictRefObj[E_REF_NAME.cf_O_lip] = base.objHead.transform.FindLoop(E_REF_NAME.cf_O_lip.ToString());
  1726.             this.dictRefObj[E_REF_NAME.cf_O_hitomi_L] = base.objHead.transform.FindLoop(E_REF_NAME.cf_O_hitomi_L.ToString());
  1727.             this.dictRefObj[E_REF_NAME.cf_O_hitomi_R] = base.objHead.transform.FindLoop(E_REF_NAME.cf_O_hitomi_R.ToString());
  1728.             this.dictRefObj[E_REF_NAME.cf_O_sitamof] = base.objHead.transform.FindLoop(E_REF_NAME.cf_O_sitamof.ToString());
  1729.             this.dictRefObj[E_REF_NAME.NP_cf_acs_megane] = base.objHead.transform.FindLoop(E_REF_NAME.NP_cf_acs_megane.ToString());
  1730.             this.dictRefObj[E_REF_NAME.cf_J_mouth] = base.objHead.transform.FindLoop(E_REF_NAME.cf_J_mouth.ToString());
  1731.         }
  1732.         if ((flags & 8) != 0)
  1733.         {
  1734.             this.dictRefObj[E_REF_NAME.N_cf_panst] = this.objPanst.transform.FindLoop(E_REF_NAME.N_cf_panst.ToString());
  1735.             this.dictRefObj[E_REF_NAME.N_panst_d] = this.objPanst.transform.FindLoop(E_REF_NAME.N_panst_d.ToString());
  1736.             this.dictRefObj[E_REF_NAME.N_panst_n] = this.objPanst.transform.FindLoop(E_REF_NAME.N_panst_n.ToString());
  1737.         }
  1738.         if ((flags & 0x10) != 0)
  1739.         {
  1740.             this.dictRefObj[E_REF_NAME.N_cf_socks] = this.objSocks.transform.FindLoop(E_REF_NAME.N_cf_socks.ToString());
  1741.         }
  1742.         if ((flags & 0x20) != 0)
  1743.         {
  1744.             this.dictRefObj[E_REF_NAME.N_cf_shoes] = this.objShoes.transform.FindLoop(E_REF_NAME.N_cf_shoes.ToString());
  1745.         }
  1746.         if ((flags & 0x40) != 0)
  1747.         {
  1748.             this.dictRefObj[E_REF_NAME.N_cf_acs_cap] = this.objAcs[0].transform.FindLoop(E_REF_NAME.N_cf_acs_cap.ToString());
  1749.         }
  1750.         if ((flags & 0x80) != 0)
  1751.         {
  1752.             this.dictRefObj[E_REF_NAME.N_cf_acs_megane] = this.objAcs[1].transform.FindLoop(E_REF_NAME.N_cf_acs_megane.ToString());
  1753.         }
  1754.         if ((flags & 0x100) != 0)
  1755.         {
  1756.             this.dictRefObj[E_REF_NAME.N_cf_acs_earrings] = this.objAcs[2].transform.FindLoop(E_REF_NAME.N_cf_acs_earrings.ToString());
  1757.         }
  1758.         if ((flags & 0x200) != 0)
  1759.         {
  1760.             this.dictRefObj[E_REF_NAME.N_cf_acs_head] = this.objAcs[3].transform.FindLoop(E_REF_NAME.N_cf_acs_head.ToString());
  1761.         }
  1762.         if ((flags & 0x400) != 0)
  1763.         {
  1764.             this.dictRefObj[E_REF_NAME.N_cf_acs_back] = this.objAcs[4].transform.FindLoop(E_REF_NAME.N_cf_acs_back.ToString());
  1765.         }
  1766.         if ((flags & 0x800) != 0)
  1767.         {
  1768.             this.dictRefObj[E_REF_NAME.N_cf_acs_waist] = this.objAcs[5].transform.FindLoop(E_REF_NAME.N_cf_acs_waist.ToString());
  1769.         }
  1770.         if ((flags & 0x1000) != 0)
  1771.         {
  1772.             this.dictRefObj[E_REF_NAME.N_cf_acs_wrist_l] = this.objAcs[6].transform.FindLoop(E_REF_NAME.N_cf_acs_wrist_l.ToString());
  1773.         }
  1774.         if ((flags & 0x2000) != 0)
  1775.         {
  1776.             this.dictRefObj[E_REF_NAME.N_cf_acs_wrist_r] = this.objAcs[7].transform.FindLoop(E_REF_NAME.N_cf_acs_wrist_r.ToString());
  1777.         }
  1778.         if ((flags & 0x4000) != 0)
  1779.         {
  1780.             this.dictRefObj[E_REF_NAME.N_cf_acs_neck] = this.objAcs[8].transform.FindLoop(E_REF_NAME.N_cf_acs_neck.ToString());
  1781.         }
  1782.     }
  1783.  
  1784.     public override void LateUpdate()
  1785.     {
  1786.         this.CShadowProc();
  1787.         bool flag = false;
  1788.         if (0 != this.cosTopState)
  1789.         {
  1790.             if (0 != this.cosBuraState)
  1791.             {
  1792.                 flag = true;
  1793.             }
  1794.             else if (null == this.GetRefObject(E_REF_NAME.cf_O_bra_b_d))
  1795.             {
  1796.                 flag = true;
  1797.             }
  1798.         }
  1799.         if (this.BodySubInfo.NipAlwaysStand)
  1800.         {
  1801.             flag = true;
  1802.         }
  1803.         GameObject[] objArray = new GameObject[] { this.GetRefObject(E_REF_NAME.cf_J_Mune_Nip02_s_L), this.GetRefObject(E_REF_NAME.cf_J_Mune_Nip02_s_R) };
  1804.         for (int i = 0; i < 2; i++)
  1805.         {
  1806.             if (null != objArray[i])
  1807.             {
  1808.                 objArray[i].transform.SetLocalPositionZ(!flag ? 0f : 0.003f);
  1809.                 objArray[i].transform.SetLocalScaleX(!flag ? 1f : 1.5f);
  1810.             }
  1811.         }
  1812.     }
  1813.  
  1814.     public bool LoadCharaData(BinaryReader reader, byte loadType = 0)
  1815.     {
  1816.         if (loadType == 0)
  1817.         {
  1818.             this.saveTexBytes = PngAssist.LoadPngData(reader);
  1819.         }
  1820.         else
  1821.         {
  1822.             PngAssist.SkipPngData(reader);
  1823.         }
  1824.         this.LoadVersion = reader.ReadInt32();
  1825.         if (this.LoadVersion > 0x6b)
  1826.         {
  1827.             return false;
  1828.         }
  1829.         if ((0x66 <= this.LoadVersion) && (string.Compare(reader.ReadString(), "【HaremMate Chara SaveData】") != 0))
  1830.         {
  1831.             return false;
  1832.         }
  1833.         if (0x67 <= this.LoadVersion)
  1834.         {
  1835.             this.prevInfo.LoadPreviewInfo(reader, this.LoadVersion);
  1836.         }
  1837.         if (loadType != 1)
  1838.         {
  1839.             this.charCustom.LoadCustomInfo(reader, this.LoadVersion);
  1840.             if (loadType == 2)
  1841.             {
  1842.                 return true;
  1843.             }
  1844.             this.cosCustom.LoadCosFavoriteCore(reader);
  1845.             this.charaNo = this.prevInfo.CharaNo;
  1846.             if (0x69 <= this.LoadVersion)
  1847.             {
  1848.                 this.status.Load(reader, this.LoadVersion);
  1849.             }
  1850.             if (0x6a <= this.LoadVersion)
  1851.             {
  1852.                 this.lockParam = reader.ReadBoolean();
  1853.             }
  1854.         }
  1855.         return true;
  1856.     }
  1857.  
  1858.     public bool LoadCharaData(Stream st, byte loadType = 0)
  1859.     {
  1860.         using (BinaryReader reader = new BinaryReader(st))
  1861.         {
  1862.             return this.LoadCharaData(reader, loadType);
  1863.         }
  1864.     }
  1865.  
  1866.     public bool LoadCharaData(string filename, byte loadType = 0)
  1867.     {
  1868.         string path = UserData.Path + "chara/" + filename;
  1869.         if (!File.Exists(path))
  1870.         {
  1871.             return false;
  1872.         }
  1873.         this.saveFileName = filename;
  1874.         using (FileStream stream = new FileStream(path, FileMode.Open, FileAccess.Read))
  1875.         {
  1876.             return this.LoadCharaData(stream, loadType);
  1877.         }
  1878.     }
  1879.  
  1880.     public bool LoadCharaData(string filename, string assetPath, string resourcesDir, byte loadType = 0)
  1881.     {
  1882.         string path = Singleton<Manager.Loader>.Instance.AssetPath + assetPath;
  1883.         if (string.Compare(".unity3d", Path.GetExtension(path)) != 0)
  1884.         {
  1885.             path = Path.ChangeExtension(path, ".unity3d");
  1886.         }
  1887.         Singleton<Manager.Loader>.Instance.CreateFromFile(path);
  1888.         TextAsset asset = Singleton<Manager.Loader>.Instance.AssetBundleRefs[path].assetBundle.Load(filename, typeof(TextAsset)) as TextAsset;
  1889.         Singleton<Manager.Loader>.Instance.Unload(path, false);
  1890.         if (null == asset)
  1891.         {
  1892.             return false;
  1893.         }
  1894.         using (MemoryStream stream = new MemoryStream())
  1895.         {
  1896.             stream.Write(asset.bytes, 0, asset.bytes.Length);
  1897.             stream.Seek(0L, SeekOrigin.Begin);
  1898.             return this.LoadCharaData(stream, loadType);
  1899.         }
  1900.     }
  1901.  
  1902.     public bool OverwriteCharaData(BinaryWriter writer)
  1903.     {
  1904.         if (this.saveTexBytes != null)
  1905.         {
  1906.             writer.Write(this.saveTexBytes);
  1907.         }
  1908.         return this.WriteCharaDataWithoutPNG(writer);
  1909.     }
  1910.  
  1911.     public bool OverwriteCharaData(Stream st)
  1912.     {
  1913.         using (BinaryWriter writer = new BinaryWriter(st))
  1914.         {
  1915.             return this.OverwriteCharaData(writer);
  1916.         }
  1917.     }
  1918.  
  1919.     public bool OverwriteCharaData(string filename = "")
  1920.     {
  1921.         string str = (string.Compare(filename, string.Empty) != 0) ? filename : this.saveFileName;
  1922.         using (FileStream stream = new FileStream(UserData.Create("chara") + str, FileMode.Create, FileAccess.Write))
  1923.         {
  1924.             return this.OverwriteCharaData(stream);
  1925.         }
  1926.     }
  1927.  
  1928.     public bool OverwriteCharaPNG(byte[] pngData, string filename = "")
  1929.     {
  1930.         string str = (string.Compare(filename, string.Empty) != 0) ? filename : this.saveFileName;
  1931.         using (FileStream stream = new FileStream(UserData.Create("chara") + str, FileMode.Create, FileAccess.Write))
  1932.         {
  1933.             return this.OverwriteCharaPNG(stream, pngData);
  1934.         }
  1935.     }
  1936.  
  1937.     public bool OverwriteCharaPNG(BinaryWriter writer, byte[] pngData)
  1938.     {
  1939.         if (pngData != null)
  1940.         {
  1941.             writer.Write(pngData);
  1942.         }
  1943.         return this.WriteCharaDataWithoutPNG(writer);
  1944.     }
  1945.  
  1946.     public bool OverwriteCharaPNG(Stream st, byte[] pngData)
  1947.     {
  1948.         using (BinaryWriter writer = new BinaryWriter(st))
  1949.         {
  1950.             return this.OverwriteCharaPNG(writer, pngData);
  1951.         }
  1952.     }
  1953.  
  1954.     public void ReInitHStatus()
  1955.     {
  1956.         this.status.MemberInit();
  1957.     }
  1958.  
  1959.     public bool SaveCharaDataNew(string filename, bool debug = false)
  1960.     {
  1961.         using (FileStream stream = new FileStream(UserData.Create("chara") + filename, FileMode.Create, FileAccess.Write))
  1962.         {
  1963.             using (BinaryWriter writer = new BinaryWriter(stream))
  1964.             {
  1965.                 PngAssist.SavePng(writer, !debug ? ((byte) 1) : ((byte) 0));
  1966.                 this.WriteCharaDataWithoutPNG(writer);
  1967.             }
  1968.         }
  1969.         return true;
  1970.     }
  1971.  
  1972.     public void SetAcsNo(E_ACS_KIND kind, int no)
  1973.     {
  1974.         this.acsNo[(int) kind] = new int?(no);
  1975.     }
  1976.  
  1977.     public void SetAudioSource(AudioSource _asMain, AudioSource _asSub)
  1978.     {
  1979.         this.asMain = _asMain;
  1980.         this.asSub = _asSub;
  1981.     }
  1982.  
  1983.     public void SetBlinkFlag(bool blink)
  1984.     {
  1985.         if (this.blinkCtrl != null)
  1986.         {
  1987.             this.blinkCtrl.SetFixedFlags(!blink ? ((byte) 1) : ((byte) 0));
  1988.         }
  1989.     }
  1990.  
  1991.     public void SetCharaCreateFlag(bool flags)
  1992.     {
  1993.         this.charaCreateFlag = flags;
  1994.     }
  1995.  
  1996.     public void SetCharaNo(int no)
  1997.     {
  1998.         this.charaNo = no;
  1999.     }
  2000.  
  2001.     public void SetCosBottomType(byte type)
  2002.     {
  2003.         this.cosBottomType = new byte?(type);
  2004.     }
  2005.  
  2006.     public void SetCosSodeType(byte type)
  2007.     {
  2008.         this.cosSodeType = new byte?(type);
  2009.     }
  2010.  
  2011.     public void SetCustomUpdateFlags(bool flags)
  2012.     {
  2013.         this.customUpdate = flags;
  2014.     }
  2015.  
  2016.     private void SetDBHairCollision(GameObject objHair)
  2017.     {
  2018.         if (null != objHair)
  2019.         {
  2020.             List<GameObject> list = new List<GameObject>();
  2021.             objHair.transform.FindLoopTag(list, "DBHair");
  2022.             foreach (GameObject obj2 in list)
  2023.             {
  2024.                 foreach (DynamicBone bone in obj2.GetComponents<DynamicBone>())
  2025.                 {
  2026.                     foreach (GameObject obj3 in this.listTagColHair)
  2027.                     {
  2028.                         DynamicBoneCollider component = obj3.GetComponent<DynamicBoneCollider>();
  2029.                         if (null != component)
  2030.                         {
  2031.                             bone.m_Colliders.Add(component);
  2032.                         }
  2033.                     }
  2034.                 }
  2035.             }
  2036.         }
  2037.     }
  2038.  
  2039.     public void SetEyesHi(bool show)
  2040.     {
  2041.         this.eyesHi = show;
  2042.         foreach (GameObject obj2 in this.listTagEyeHi)
  2043.         {
  2044.             if (null != obj2.renderer)
  2045.             {
  2046.                 Color color = obj2.renderer.material.color;
  2047.                 color.a = !show ? 0f : 1f;
  2048.                 obj2.renderer.material.color = color;
  2049.             }
  2050.         }
  2051.     }
  2052.  
  2053.     public void SetFixedEyebrowOpen(float rate)
  2054.     {
  2055.         if (this.EyebrowCtrl != null)
  2056.         {
  2057.             this.EyebrowCtrl.FixedRate = Mathf.Clamp(rate, 0f, 1f);
  2058.         }
  2059.     }
  2060.  
  2061.     public void SetFixedEyesOpen(float rate)
  2062.     {
  2063.         if (this.EyesCtrl != null)
  2064.         {
  2065.             float num = Mathf.Lerp(0f, 0.9f, Mathf.Clamp(rate, 0f, 1f));
  2066.             this.EyesCtrl.FixedRate = num;
  2067.         }
  2068.     }
  2069.  
  2070.     public void SetFixedMouthOpen(float rate, bool nolimit = false)
  2071.     {
  2072.         if (this.MouthCtrl != null)
  2073.         {
  2074.             if (!nolimit)
  2075.             {
  2076.                 this.MouthCtrl.FixedRate = Mathf.Clamp(rate, 0f, 1f);
  2077.             }
  2078.             else
  2079.             {
  2080.                 this.MouthCtrl.FixedRate = rate;
  2081.             }
  2082.         }
  2083.     }
  2084.  
  2085.     public void SetMouthWidth(float rate)
  2086.     {
  2087.         GameObject refObject = this.GetRefObject(E_REF_NAME.cf_J_mouth);
  2088.         if (refObject != null)
  2089.         {
  2090.             float x = Mathf.Lerp(0.9f, 1.1f, rate);
  2091.             refObject.transform.SetLocalScaleX(x);
  2092.         }
  2093.     }
  2094.  
  2095.     public void SetNeckFixAngle(Quaternion fixQ)
  2096.     {
  2097.         if (null != this.neckLookCtrl)
  2098.         {
  2099.             this.neckLookCtrl.neckLookScript.fixAngle = fixQ;
  2100.         }
  2101.     }
  2102.  
  2103.     public void SetPanstNo(int no)
  2104.     {
  2105.         this.panstNo = new int?(no);
  2106.     }
  2107.  
  2108.     public void SetShoesNo(int no)
  2109.     {
  2110.         this.shoesNo = new int?(no);
  2111.     }
  2112.  
  2113.     public bool SetSiru(byte targ, int lv)
  2114.     {
  2115.         string assetfilePath = "chara/cha_etc.unity3d";
  2116.         if (targ == 0)
  2117.         {
  2118.             Material[] materialArray = new Material[2];
  2119.             if (lv != 0)
  2120.             {
  2121.                 for (int i = 0; i < 2; i++)
  2122.                 {
  2123.                     string resourcePath = "Prefabs/chara/etc/siru_f" + lv.ToString("00") + "_" + i.ToString();
  2124.                     materialArray[i] = Helper.Loader.Load(assetfilePath, resourcePath, typeof(Material)) as Material;
  2125.                 }
  2126.             }
  2127.             foreach (GameObject obj2 in this.listTagSkinF)
  2128.             {
  2129.                 Renderer component = obj2.GetComponent<Renderer>();
  2130.                 if (null != component)
  2131.                 {
  2132.                     if (lv == 0)
  2133.                     {
  2134.                         component.materials = new Material[] { component.material };
  2135.                     }
  2136.                     else
  2137.                     {
  2138.                         component.materials = new Material[] { component.material, materialArray[0], materialArray[1] };
  2139.                     }
  2140.                 }
  2141.             }
  2142.         }
  2143.         else if (targ == 1)
  2144.         {
  2145.             Material[] materialArray4 = new Material[2];
  2146.             if (lv != 0)
  2147.             {
  2148.                 for (int j = 0; j < 2; j++)
  2149.                 {
  2150.                     string str3 = "Prefabs/chara/etc/siru_b" + lv.ToString("00") + "_" + j.ToString();
  2151.                     materialArray4[j] = Helper.Loader.Load(assetfilePath, str3, typeof(Material)) as Material;
  2152.                 }
  2153.             }
  2154.             foreach (GameObject obj3 in this.listTagSkinB)
  2155.             {
  2156.                 Renderer renderer2 = obj3.GetComponent<Renderer>();
  2157.                 if (null != renderer2)
  2158.                 {
  2159.                     if (lv == 0)
  2160.                     {
  2161.                         renderer2.materials = new Material[] { renderer2.material };
  2162.                     }
  2163.                     else
  2164.                     {
  2165.                         renderer2.materials = new Material[] { renderer2.material, materialArray4[0], materialArray4[1] };
  2166.                     }
  2167.                 }
  2168.             }
  2169.         }
  2170.         return true;
  2171.     }
  2172.  
  2173.     public void SetSocksNo(int no)
  2174.     {
  2175.         this.socksNo = new int?(no);
  2176.     }
  2177.  
  2178.     public override void SetVisibleSub(bool Visible)
  2179.     {
  2180.         if (this.objPanst != null)
  2181.         {
  2182.             this.objPanst.SetActive(Visible);
  2183.         }
  2184.         if (this.objSocks != null)
  2185.         {
  2186.             this.objSocks.SetActive(Visible);
  2187.         }
  2188.         if (this.objShoes != null)
  2189.         {
  2190.             this.objShoes.SetActive(Visible);
  2191.         }
  2192.         foreach (GameObject obj2 in this.objAcs)
  2193.         {
  2194.             obj2.SetActive(Visible);
  2195.         }
  2196.         if (this.objEyeline != null)
  2197.         {
  2198.             this.objEyeline.SetActive(Visible);
  2199.         }
  2200.         if (this.objHairF != null)
  2201.         {
  2202.             this.objHairF.SetActive(Visible);
  2203.         }
  2204.         if (this.objHairB != null)
  2205.         {
  2206.             this.objHairB.SetActive(Visible);
  2207.         }
  2208.         if (this.objHairS != null)
  2209.         {
  2210.             this.objHairS.SetActive(Visible);
  2211.         }
  2212.         if (this.objHairO != null)
  2213.         {
  2214.             this.objHairO.SetActive(Visible);
  2215.         }
  2216.         this.customUpdate = true;
  2217.     }
  2218.  
  2219.     public override void Update()
  2220.     {
  2221.         if (this.customUpdate)
  2222.         {
  2223.             this.charCustom.UpdateShapeFace();
  2224.             this.charCustom.UpdateShapeBody();
  2225.             if (null != this.objEyeline)
  2226.             {
  2227.                 Animator component = this.objEyeline.GetComponent<Animator>();
  2228.                 int num = 8;
  2229.                 if (num <= component.layerCount)
  2230.                 {
  2231.                     for (int i = 0; i < num; i++)
  2232.                     {
  2233.                         component.Play(component.GetCurrentAnimatorStateInfo(i + 1).nameHash, i + 1, this.charCustom.nowCCI.shapeFace[i]);
  2234.                     }
  2235.                 }
  2236.             }
  2237.             this.customUpdate = false;
  2238.         }
  2239.         this.UpdateSiru();
  2240.         this.blinkCtrl.CalcBlink();
  2241.         this.UpdateBlendShapeVoice();
  2242.     }
  2243.  
  2244.     private void UpdateBlendShapeVoice()
  2245.     {
  2246.         float audioWaveValue = 0f;
  2247.         if ((this.asMain != null) && this.asMain.isPlaying)
  2248.         {
  2249.             audioWaveValue = this.fbsaaVoice.GetAudioWaveValue(this.asMain);
  2250.         }
  2251.         if (((audioWaveValue == 0f) && (this.asSub != null)) && this.asSub.isPlaying)
  2252.         {
  2253.             audioWaveValue = this.fbsaaVoice.GetAudioWaveValue(this.asSub);
  2254.         }
  2255.         if (this.fbsCtrlHead != null)
  2256.         {
  2257.             this.fbsCtrlHead.SetVoiceVaule(audioWaveValue);
  2258.         }
  2259.     }
  2260.  
  2261.     public void UpdateCustomInfo()
  2262.     {
  2263.         int? nipTexType = this.charCustom.nowCCI.nipTexType;
  2264.         int? nipTexColor = this.charCustom.nowCCI.nipTexColor;
  2265.         this.charCustom.ChangeTexNip(!nipTexType.HasValue ? 0 : nipTexType.Value, !nipTexColor.HasValue ? 0 : nipTexColor.Value, true);
  2266.         this.charCustom.ChangeNipShader(this.charCustom.nowCCI.nipAlpha);
  2267.         int? skinTexColor = this.charCustom.nowCCI.skinTexColor;
  2268.         this.charCustom.ChangeTexSkin(!skinTexColor.HasValue ? 0 : skinTexColor.Value, true);
  2269.         int? uhairTexType = this.charCustom.nowCCI.uhairTexType;
  2270.         this.charCustom.ChangeTexUHair(!uhairTexType.HasValue ? 0 : uhairTexType.Value, true);
  2271.         this.charCustom.ChangeUHairShader(this.charCustom.nowCCI.uhairColor, this.charCustom.nowCCI.uhairAlpha);
  2272.         int? nullable5 = this.charCustom.nowCCI.skinTexColor;
  2273.         this.charCustom.ChangeTexSkin(!nullable5.HasValue ? 0 : nullable5.Value, true);
  2274.         int? eyeblowTexType = this.charCustom.nowCCI.eyeblowTexType;
  2275.         this.charCustom.ChangeTexEyeBlow(!eyeblowTexType.HasValue ? 0 : eyeblowTexType.Value, true);
  2276.         this.charCustom.ChangeEyeblowShader(this.charCustom.nowCCI.eyeblowColor);
  2277.         int? eyeTexType = this.charCustom.nowCCI.eyeTexType;
  2278.         this.charCustom.ChangeTexEye(!eyeTexType.HasValue ? 0 : eyeTexType.Value, true);
  2279.         for (int i = 0; i < 2; i++)
  2280.         {
  2281.             this.charCustom.ChangeEyeShader((byte) i, this.charCustom.nowCCI.eyeColor[i]);
  2282.         }
  2283.         int? eyeHiTexType = this.charCustom.nowCCI.eyeHiTexType;
  2284.         this.charCustom.ChangeTexEyeHi(!eyeHiTexType.HasValue ? 0 : eyeHiTexType.Value, true);
  2285.         this.charCustom.ChangeLipShader(this.charCustom.nowCCI.lipColor, this.charCustom.nowCCI.lipAlpha);
  2286.         this.SetCustomUpdateFlags(true);
  2287.         this.ChangeHeadFromSetting(true);
  2288.         this.ChangeHairFromSetting(true);
  2289.     }
  2290.  
  2291.     public void UpdateSiru()
  2292.     {
  2293.         for (int i = 0; i < 2; i++)
  2294.         {
  2295.             if (this.siruLv[i] != this.updateSiruLv[i])
  2296.             {
  2297.                 this.SetSiru((byte) i, this.updateSiruLv[i]);
  2298.                 this.siruLv[i] = this.updateSiruLv[i];
  2299.             }
  2300.         }
  2301.     }
  2302.  
  2303.     public void UpdateSiruFlag(byte targ = 2, int lv = -1)
  2304.     {
  2305.         if (lv == -1)
  2306.         {
  2307.             int num;
  2308.             if ((targ == 0) || (targ == 2))
  2309.             {
  2310.                 this.updateSiruLv[0] = num = this.updateSiruLv[0] + 1;
  2311.                 this.updateSiruLv[0] = Mathf.Min(num, 3);
  2312.             }
  2313.             if ((targ == 1) || (targ == 2))
  2314.             {
  2315.                 this.updateSiruLv[1] = num = this.updateSiruLv[1] + 1;
  2316.                 this.updateSiruLv[1] = Mathf.Min(num, 3);
  2317.             }
  2318.         }
  2319.         else
  2320.         {
  2321.             if ((targ == 0) || (targ == 2))
  2322.             {
  2323.                 this.updateSiruLv[0] = lv;
  2324.             }
  2325.             if ((targ == 1) || (targ == 2))
  2326.             {
  2327.                 this.updateSiruLv[1] = lv;
  2328.             }
  2329.         }
  2330.     }
  2331.  
  2332.     public bool WriteCharaDataWithoutPNG(BinaryWriter writer)
  2333.     {
  2334.         writer.Write(0x6b);
  2335.         writer.Write("【HaremMate Chara SaveData】");
  2336.         writer.Write(this.charCustom.nowCCI.lastName);
  2337.         writer.Write(this.charCustom.nowCCI.firstName);
  2338.         int? personalType = this.charCustom.nowCCI.personalType;
  2339.         this.charCustom.nowCCI.personalType = new int?(!personalType.HasValue ? 0 : personalType.Value);
  2340.         writer.Write(this.charCustom.nowCCI.personalType.Value);
  2341.         byte num = 0;
  2342.         float num2 = this.charCustom.nowCCI.shapeBody[0];
  2343.         if (num2 < 0.33f)
  2344.         {
  2345.             num = 0;
  2346.         }
  2347.         else if (num2 < 0.66f)
  2348.         {
  2349.             num = 1;
  2350.         }
  2351.         else
  2352.         {
  2353.             num = 2;
  2354.         }
  2355.         writer.Write(num);
  2356.         writer.Write(this.charCustom.nowCCI.hairBNo.Value);
  2357.         if (this.charaCreateFlag)
  2358.         {
  2359.             writer.Write(Singleton<Game>.Instance.productionName);
  2360.         }
  2361.         else
  2362.         {
  2363.             writer.Write(this.prevInfo.PCName);
  2364.         }
  2365.         writer.Write(!this.status._actCnt.virgin ? ((byte) 0) : ((byte) 1));
  2366.         writer.Write(this.status._actCnt.sexCount);
  2367.         writer.Write(this.charaNo);
  2368.         writer.Write(this.lockParam);
  2369.         this.charCustom.SaveCustomInfo(writer);
  2370.         this.cosCustom.SaveCosFavoriteCore(writer);
  2371.         this.status.Save(writer);
  2372.         writer.Write(this.lockParam);
  2373.         return true;
  2374.     }
  2375.  
  2376.     public class BodySubInfoClass
  2377.     {
  2378.         public bool[] Bottom = new bool[2];
  2379.         public bool IsBottom;
  2380.         public bool IsBura;
  2381.         public bool IsDBSkirt = true;
  2382.         public bool IsDBZubon = true;
  2383.         public bool IsOption;
  2384.         public bool IsPants;
  2385.         public bool IsTBSet;
  2386.         public bool NipAlwaysStand;
  2387.         public bool[] Sode = new bool[3];
  2388.         public bool UsePanst = true;
  2389.  
  2390.         public void SetFlags(string type)
  2391.         {
  2392.             char[] separator = new char[] { '/' };
  2393.             string[] strArray = type.Split(separator);
  2394.             if (strArray.Length != 10)
  2395.             {
  2396.                 Debug.LogError("体サブ情報量が足りません");
  2397.             }
  2398.             else
  2399.             {
  2400.                 this.IsTBSet = int.Parse(strArray[0]) != 0;
  2401.                 this.Sode[0] = (int.Parse(strArray[1]) & 1) != 0;
  2402.                 this.Sode[1] = (int.Parse(strArray[1]) & 2) != 0;
  2403.                 this.Sode[2] = (int.Parse(strArray[1]) & 4) != 0;
  2404.                 this.Bottom[0] = (int.Parse(strArray[2]) & 1) != 0;
  2405.                 this.Bottom[1] = (int.Parse(strArray[2]) & 2) != 0;
  2406.                 this.IsBottom = int.Parse(strArray[3]) != 0;
  2407.                 this.IsBura = int.Parse(strArray[4]) != 0;
  2408.                 this.IsPants = int.Parse(strArray[5]) != 0;
  2409.                 this.UsePanst = int.Parse(strArray[6]) != 0;
  2410.                 this.IsOption = int.Parse(strArray[7]) != 0;
  2411.                 int num = int.Parse(strArray[8]);
  2412.                 if (num == 0)
  2413.                 {
  2414.                     this.IsDBSkirt = false;
  2415.                     this.IsDBZubon = false;
  2416.                 }
  2417.                 else
  2418.                 {
  2419.                     this.IsDBSkirt = (num & 1) != 0;
  2420.                     this.IsDBZubon = (num & 2) != 0;
  2421.                 }
  2422.                 this.NipAlwaysStand = int.Parse(strArray[9]) != 0;
  2423.             }
  2424.         }
  2425.     }
  2426.  
  2427.     public enum E_ACS_KIND
  2428.     {
  2429.         ACS_CAP,
  2430.         ACS_MEGANE,
  2431.         ACS_EARRINGS,
  2432.         ACS_HEAD,
  2433.         ACS_BACK,
  2434.         ACS_WAIST,
  2435.         ACS_WRIST_L,
  2436.         ACS_WRIST_R,
  2437.         ACS_NECK,
  2438.         ACS_KIND_NUM
  2439.     }
  2440.  
  2441.     public enum E_REF_NAME
  2442.     {
  2443.         cf_Joint_00,
  2444.         cf_J_sk_top_dam,
  2445.         cf_J_ArmUp00_L,
  2446.         cf_J_ArmUp00_R,
  2447.         cf_J_LegUp02_L,
  2448.         cf_J_LegUp02_R,
  2449.         cf_J_Hips,
  2450.         cf_J_Head_s,
  2451.         cf_O_hohoaka,
  2452.         cf_O_lip,
  2453.         cf_O_hitomi_L,
  2454.         cf_O_hitomi_R,
  2455.         cf_O_tang,
  2456.         cf_O_sitamof,
  2457.         cf_J_Mune_Nip02_s_L,
  2458.         cf_J_Mune_Nip02_s_R,
  2459.         cf_J_Mune00,
  2460.         cf_J_Neck,
  2461.         NP_cf_acs_back,
  2462.         NP_cf_acs_waist,
  2463.         NP_cf_acs_wrist_l,
  2464.         NP_cf_acs_wrist_r,
  2465.         NP_cf_acs_neck,
  2466.         NP_cf_acs_megane,
  2467.         N_bottoms_a,
  2468.         N_bottoms_b,
  2469.         N_tops_a,
  2470.         N_tops_b,
  2471.         N_tops_c,
  2472.         N_bot_a_d,
  2473.         N_bot_a_n,
  2474.         N_bot_b_d,
  2475.         N_bot_b_n,
  2476.         N_bra_a,
  2477.         N_sode,
  2478.         N_sode01,
  2479.         N_sode02,
  2480.         N_sode03,
  2481.         cf_O_bra_a_d,
  2482.         cf_O_bra_a_n,
  2483.         N_bra_b,
  2484.         cf_O_bra_b_d,
  2485.         cf_O_bra_b_n,
  2486.         N_bra_c,
  2487.         cf_O_bra_c_d,
  2488.         cf_O_bra_c_n,
  2489.         N_shorts,
  2490.         cf_O_shorts_d,
  2491.         cf_O_shorts_n,
  2492.         N_option1,
  2493.         N_option2,
  2494.         N_cf_panst,
  2495.         N_panst_d,
  2496.         N_panst_n,
  2497.         N_cf_socks,
  2498.         N_cf_shoes,
  2499.         N_cf_acs_cap,
  2500.         N_cf_acs_megane,
  2501.         N_cf_acs_earrings,
  2502.         N_cf_acs_head,
  2503.         N_cf_acs_back,
  2504.         N_cf_acs_waist,
  2505.         N_cf_acs_wrist_l,
  2506.         N_cf_acs_wrist_r,
  2507.         N_cf_acs_neck,
  2508.         cf_J_mouth
  2509.     }
  2510.  
  2511.     public class PreviewInfo
  2512.     {
  2513.         public byte BustType;
  2514.         public int CharaNo = -1;
  2515.         public string FirstName = string.Empty;
  2516.         public int HairBNo;
  2517.         public int HCount;
  2518.         public byte IsVirgin = 1;
  2519.         public string LastName = string.Empty;
  2520.         public bool paramLock;
  2521.         public string PCName = string.Empty;
  2522.         public int PersonalType;
  2523.  
  2524.         public void LoadPreviewInfo(BinaryReader reader, int loadVersion)
  2525.         {
  2526.             this.LastName = reader.ReadString();
  2527.             this.FirstName = reader.ReadString();
  2528.             this.PersonalType = reader.ReadInt32();
  2529.             this.BustType = reader.ReadByte();
  2530.             this.HairBNo = reader.ReadInt32();
  2531.             this.PCName = reader.ReadString();
  2532.             this.IsVirgin = reader.ReadByte();
  2533.             this.HCount = reader.ReadInt32();
  2534.             if (0x68 <= loadVersion)
  2535.             {
  2536.                 this.CharaNo = reader.ReadInt32();
  2537.             }
  2538.             if (0x6b <= loadVersion)
  2539.             {
  2540.                 this.paramLock = reader.ReadBoolean();
  2541.             }
  2542.         }
  2543.     }
  2544. }
clone this paste RAW Paste Data