using FBSAssist;
using Helper;
using IllusionUtility.GetUtility;
using IllusionUtility.SetUtility;
using Manager;
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using UnityEngine;
[Serializable]
public class CharFemale : CharBase
{
[CompilerGenerated]
private static Dictionary<string, int> <>f__switch$map6;
private int?[] acsNo = new int?[9];
private AudioSource asMain;
private AudioSource asSub;
private FBSBlinkControl blinkCtrl = new FBSBlinkControl();
public BodySubInfoClass BodySubInfo = new BodySubInfoClass();
public BustScaleInfo bustScaleInfo = new BustScaleInfo();
private bool charaCreateFlag;
private int charaNo = -1;
private CharCustom charCustom;
private float cheekAlpha;
private byte?[] cosAcsState = new byte?[9];
private byte? cosBottomState;
private byte? cosBottomType;
private byte? cosBuraState;
private CosCustom cosCustom;
private byte?[] cosOptionsState = new byte?[2];
private byte? cosPanstState;
private byte? cosPantsState;
private byte? cosShoesState;
private byte? cosSocksState;
private byte? cosSodeType;
private byte? cosTopState;
private bool customUpdate = true;
private const string deleteBoneName = "cf_Joint_00";
protected Dictionary<E_REF_NAME, GameObject> dictRefObj = new Dictionary<E_REF_NAME, GameObject>();
private FBSCtrlEyebrow EyebrowCtrl;
private EyeLookController eyeLookCtrl;
public EyeScaleInfo eyeScaleInfo = new EyeScaleInfo();
private FBSCtrlEyes EyesCtrl;
private bool eyesHi = true;
private AudioAssist fbsaaVoice = new AudioAssist();
private FaceBlendShape fbsCtrlELine;
private FaceBlendShape fbsCtrlHead;
public string female_dir = "Prefabs/chara/female/";
private List<GameObject> listMeshHairB = new List<GameObject>();
private List<GameObject> listMeshHairF = new List<GameObject>();
private List<GameObject> listMeshHairO = new List<GameObject>();
private List<GameObject> listMeshHairS = new List<GameObject>();
private List<GameObject> listTagColHair = new List<GameObject>();
private List<GameObject> listTagEyeblow = new List<GameObject>();
private List<GameObject> listTagEyeHi = new List<GameObject>();
private List<GameObject> listTagEyeL = new List<GameObject>();
private List<GameObject> listTagEyeline = new List<GameObject>();
private List<GameObject> listTagEyeR = new List<GameObject>();
private List<GameObject> listTagNail = new List<GameObject>();
private List<GameObject> listTagNip = new List<GameObject>();
private List<GameObject> listTagSkinB = new List<GameObject>();
private List<GameObject> listTagSkinE = new List<GameObject>();
private List<GameObject> listTagSkinF = new List<GameObject>();
private List<GameObject> listTagUHair = new List<GameObject>();
public int LoadVersion = 100;
public bool lockParam;
private int lookTargetE;
private int lookTargetN;
private FBSCtrlMouth MouthCtrl;
private NeckLookController neckLookCtrl;
private GameObject[] objAcs = new GameObject[9];
private GameObject objEyeline;
private GameObject objHairB;
private GameObject objHairF;
private GameObject objHairO;
private GameObject objHairS;
private GameObject objPanst;
private GameObject objShoes;
private GameObject objSocks;
private int? panstNo;
public PreviewInfo prevInfo = new PreviewInfo();
private int ptnBsEyeblow;
private int ptnBsEyes;
private int ptnBsMouth;
private string saveFileName = string.Empty;
public const string SaveMark = "【HaremMate Chara SaveData】";
private byte[] saveTexBytes;
public const int SaveVersion = 0x6b;
private int? shoesNo;
private int[] siruLv = new int[2];
private int? socksNo;
private FemaleHStatus status;
private byte? tongueType;
private int[] updateSiruLv = new int[2];
public void ChangeAccessory(E_ACS_KIND kind, int No, bool forceChange = false)
{
int index = (int) kind;
bool flag = false;
if (forceChange)
{
if (-1 != this.acsNo[index])
{
this.acsNo[index] = -2;
}
}
else if ((-1 != this.acsNo[index]) && (null == this.objAcs[index]))
{
this.acsNo[index] = -2;
}
GameObject refObject = null;
ListInfo.EInfoType type = ListInfo.EInfoType.ELI_F_AcsCap;
string name = string.Empty;
switch (kind)
{
case E_ACS_KIND.ACS_CAP:
refObject = this.GetRefObject(E_REF_NAME.cf_J_Head_s);
type = ListInfo.EInfoType.ELI_F_AcsCap;
name = "cf_acs_cap";
break;
case E_ACS_KIND.ACS_MEGANE:
refObject = this.GetRefObject(E_REF_NAME.NP_cf_acs_megane);
type = ListInfo.EInfoType.ELI_F_AcsMegane;
name = "cf_acs_megane";
break;
case E_ACS_KIND.ACS_EARRINGS:
refObject = this.GetRefObject(E_REF_NAME.cf_J_Head_s);
type = ListInfo.EInfoType.ELI_F_AcsEarrings;
name = "cf_acs_earrings";
break;
case E_ACS_KIND.ACS_HEAD:
refObject = this.GetRefObject(E_REF_NAME.cf_J_Head_s);
type = ListInfo.EInfoType.ELI_F_AcsHead;
name = "cf_acs_head";
break;
case E_ACS_KIND.ACS_BACK:
refObject = this.GetRefObject(E_REF_NAME.NP_cf_acs_back);
type = ListInfo.EInfoType.ELI_F_AcsBack;
name = "cf_acs_back";
break;
case E_ACS_KIND.ACS_WAIST:
refObject = this.GetRefObject(E_REF_NAME.NP_cf_acs_waist);
type = ListInfo.EInfoType.ELI_F_AcsWaist;
name = "cf_acs_waist";
break;
case E_ACS_KIND.ACS_WRIST_L:
refObject = this.GetRefObject(E_REF_NAME.NP_cf_acs_wrist_l);
type = ListInfo.EInfoType.ELI_F_AcsWristL;
name = "cf_acs_wrist_l";
break;
case E_ACS_KIND.ACS_WRIST_R:
refObject = this.GetRefObject(E_REF_NAME.NP_cf_acs_wrist_r);
type = ListInfo.EInfoType.ELI_F_AcsWristR;
name = "cf_acs_wrist_r";
break;
case E_ACS_KIND.ACS_NECK:
refObject = this.GetRefObject(E_REF_NAME.NP_cf_acs_neck);
type = ListInfo.EInfoType.ELI_F_AcsNeck;
name = "cf_acs_neck";
flag = true;
break;
}
if ((No != -1) && (No != this.acsNo[index]))
{
if (this.objAcs[index] != null)
{
CommonAssist.Destroy(ref this.objAcs[index]);
}
Dictionary<int, ListTypeChara> charaObjList = base.listInfo.GetCharaObjList(type, true);
if (!charaObjList.ContainsKey(No))
{
No = 0;
}
this.objAcs[index] = CommonAssist.LoadCloneFromAssetBundle(charaObjList[No].ABName, charaObjList[No].PName, name, base.objTop);
if (null != this.objAcs[index])
{
if (flag)
{
if (base.aaWeights != null)
{
base.aaWeights.AssignedWeights(this.objAcs[index], "cf_Joint_00");
}
}
else if (null != refObject)
{
this.objAcs[index].transform.parent = refObject.transform;
this.objAcs[index].transform.SetLocalPosition(0f, 0f, 0f);
this.objAcs[index].transform.SetLocalRotation(0f, 0f, 0f);
this.objAcs[index].transform.SetLocalScale(1f, 1f, 1f);
}
}
this.acsNo[index] = new int?(No);
}
switch (kind)
{
case E_ACS_KIND.ACS_CAP:
this.InitRefObject(0x40);
break;
case E_ACS_KIND.ACS_MEGANE:
this.InitRefObject(0x80);
break;
case E_ACS_KIND.ACS_EARRINGS:
this.InitRefObject(0x100);
break;
case E_ACS_KIND.ACS_HEAD:
this.InitRefObject(0x200);
break;
case E_ACS_KIND.ACS_BACK:
this.InitRefObject(0x400);
break;
case E_ACS_KIND.ACS_WAIST:
this.InitRefObject(0x800);
break;
case E_ACS_KIND.ACS_WRIST_L:
this.InitRefObject(0x1000);
break;
case E_ACS_KIND.ACS_WRIST_R:
this.InitRefObject(0x2000);
break;
case E_ACS_KIND.ACS_NECK:
this.InitRefObject(0x4000);
break;
}
byte? nullable4 = this.cosAcsState[index];
this.ChangeCosAcsState(kind, !nullable4.HasValue ? ((byte) 0) : nullable4.Value, true);
}
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)
{
this.ChangeAccessory(E_ACS_KIND.ACS_CAP, CapNo, forceChange);
this.ChangeAccessory(E_ACS_KIND.ACS_MEGANE, MeganeNo, forceChange);
this.ChangeAccessory(E_ACS_KIND.ACS_EARRINGS, EarringsNo, forceChange);
this.ChangeAccessory(E_ACS_KIND.ACS_HEAD, HeadNo, forceChange);
this.ChangeAccessory(E_ACS_KIND.ACS_BACK, backNo, forceChange);
this.ChangeAccessory(E_ACS_KIND.ACS_WAIST, waistNo, forceChange);
this.ChangeAccessory(E_ACS_KIND.ACS_WRIST_L, wristLNo, forceChange);
this.ChangeAccessory(E_ACS_KIND.ACS_WRIST_R, wristRNo, forceChange);
this.ChangeAccessory(E_ACS_KIND.ACS_NECK, neckNo, forceChange);
}
public void ChangeAccessoryFromSetting(bool forceChange = true)
{
int? nullable = this.acsNo[0];
int? nullable2 = this.acsNo[1];
int? nullable3 = this.acsNo[2];
int? nullable4 = this.acsNo[3];
int? nullable5 = this.acsNo[4];
int? nullable6 = this.acsNo[5];
int? nullable7 = this.acsNo[6];
int? nullable8 = this.acsNo[7];
int? nullable9 = this.acsNo[8];
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);
}
public void ChangeActive(E_REF_NAME nameID, bool active)
{
GameObject refObject = this.GetRefObject(nameID);
if (null != refObject)
{
refObject.SetActive(active);
}
}
public void ChangeAndSaveLockParam(string loadfilename, bool lockFlag)
{
this.charCustom = new CharCustom();
this.charCustom.Init(this, Singleton<Character>.Instance.listinfo);
this.cosCustom = new CosCustom();
this.cosCustom.Init(this, Singleton<Character>.Instance.listinfo);
GameObject obj2 = new GameObject("work");
this.status = obj2.AddComponent<FemaleHStatus>();
this.LoadCharaData(loadfilename, 0);
this.lockParam = lockFlag;
this.OverwriteCharaData(string.Empty);
UnityEngine.Object.Destroy(obj2);
obj2 = null;
}
public void ChangeBody(int _bodyNo = -1, int _panstNo = -1, int _socksNo = -1, int _shoesNo = -1, bool forceChange = false)
{
if (forceChange)
{
if (_bodyNo != -1)
{
base.bodyNo = -2;
}
if (_panstNo != -1)
{
this.panstNo = -2;
}
if (_socksNo != -1)
{
this.socksNo = -2;
}
if (_shoesNo != -1)
{
this.shoesNo = -2;
}
}
else
{
if ((_bodyNo != -1) && (null == base.objBody))
{
base.bodyNo = -2;
}
if ((_panstNo != -1) && (null == this.objPanst))
{
this.panstNo = -2;
}
if ((_socksNo != -1) && (null == this.objSocks))
{
this.socksNo = -2;
}
if ((_shoesNo != -1) && (null == this.objShoes))
{
this.shoesNo = -2;
}
}
if ((_bodyNo != -1) && (_bodyNo != base.bodyNo))
{
if (base.objBody != null)
{
this.bustScaleInfo.Release();
CommonAssist.Destroy(ref this.objBody);
}
Dictionary<int, ListTypeChara> charaObjList = base.listInfo.GetCharaObjList(ListInfo.EInfoType.ELI_F_Body, true);
if (!charaObjList.ContainsKey(_bodyNo))
{
_bodyNo = 0;
}
string str = string.Empty;
base.objBody = CommonAssist.LoadCloneFromAssetBundle(charaObjList[_bodyNo].ABName, charaObjList[_bodyNo].PName, "cf_body", base.objTop);
if ((null != base.objBody) && (base.aaWeights != null))
{
base.aaWeights.AssignedWeights(base.objBody, "cf_Joint_00");
}
this.bustScaleInfo.LoadNormalData(charaObjList[_bodyNo].ABName, this.female_dir + str + charaObjList[_bodyNo].PName + "_Nml");
this.bustScaleInfo.InitTargetObj(base.objBody);
this.BodySubInfo.SetFlags(charaObjList[_bodyNo].Type);
Texture[] tex = new Texture[4];
for (int i = 0; i < 4; i++)
{
string resourcePath = "Prefabs/chara/etc/cf_t_mnpb_00_" + i.ToString("00");
tex[i] = Helper.Loader.Load("chara/cha_etc.unity3d", resourcePath, typeof(Texture)) as Texture;
}
string[] strArray = new string[] { "cf_O_mnpa_00", "cf_O_mnpb_00" };
for (int j = 0; j < 2; j++)
{
GameObject obj2 = base.objBody.transform.FindLoop(strArray[j]);
if (null == obj2)
{
Debug.LogError("モザイクオブジェクトが認識できません");
}
else
{
obj2.AddComponent<ChangePtnAnime>().Init(tex);
}
}
base.bodyNo = new int?(_bodyNo);
this.siruLv[1] = 0;
}
if ((_panstNo != -1) && (_panstNo != this.panstNo))
{
if (this.objPanst != null)
{
CommonAssist.Destroy(ref this.objPanst);
}
Dictionary<int, ListTypeChara> dictionary2 = base.listInfo.GetCharaObjList(ListInfo.EInfoType.ELI_F_Panst, true);
if (!dictionary2.ContainsKey(_panstNo))
{
_panstNo = 0;
}
this.objPanst = CommonAssist.LoadCloneFromAssetBundle(dictionary2[_panstNo].ABName, dictionary2[_panstNo].PName, "cf_panst", base.objTop);
if ((null != this.objPanst) && (base.aaWeights != null))
{
base.aaWeights.AssignedWeights(this.objPanst, "cf_Joint_00");
}
this.panstNo = new int?(_panstNo);
}
if ((_socksNo != -1) && (_socksNo != this.socksNo))
{
if (this.objSocks != null)
{
CommonAssist.Destroy(ref this.objSocks);
}
Dictionary<int, ListTypeChara> dictionary3 = base.listInfo.GetCharaObjList(ListInfo.EInfoType.ELI_F_Socks, true);
if (!dictionary3.ContainsKey(_socksNo))
{
_socksNo = 0;
}
this.objSocks = CommonAssist.LoadCloneFromAssetBundle(dictionary3[_socksNo].ABName, dictionary3[_socksNo].PName, "cf_socks", base.objTop);
if ((null != this.objSocks) && (base.aaWeights != null))
{
base.aaWeights.AssignedWeights(this.objSocks, "cf_Joint_00");
}
this.socksNo = new int?(_socksNo);
}
if ((_shoesNo != -1) && (_shoesNo != this.shoesNo))
{
if (this.objShoes != null)
{
CommonAssist.Destroy(ref this.objShoes);
}
Dictionary<int, ListTypeChara> dictionary4 = base.listInfo.GetCharaObjList(ListInfo.EInfoType.ELI_F_Shoes, true);
if (!dictionary4.ContainsKey(_shoesNo))
{
_shoesNo = 0;
}
this.objShoes = CommonAssist.LoadCloneFromAssetBundle(dictionary4[_shoesNo].ABName, dictionary4[_shoesNo].PName, "cf_shoes", base.objTop);
if ((null != this.objShoes) && (base.aaWeights != null))
{
base.aaWeights.AssignedWeights(this.objShoes, "cf_Joint_00");
}
this.shoesNo = new int?(_shoesNo);
}
this.InitRefObject(0x3a);
this.GetMeshInBodyFromTag();
byte? cosTopState = this.cosTopState;
this.ChangeCosTopState(!cosTopState.HasValue ? ((byte) 0) : cosTopState.Value, true);
byte? cosSodeType = this.cosSodeType;
this.ChangeCosSodeType(!cosSodeType.HasValue ? ((byte) 1) : cosSodeType.Value, true);
byte? cosBottomType = this.cosBottomType;
this.ChangeCosBottomType(!cosBottomType.HasValue ? ((byte) 0) : cosBottomType.Value, true);
byte? cosBottomState = this.cosBottomState;
this.ChangeCosBottomState(!cosBottomState.HasValue ? ((byte) 0) : cosBottomState.Value, true);
byte? cosBuraState = this.cosBuraState;
this.ChangeCosBuraState(!cosBuraState.HasValue ? ((byte) 0) : cosBuraState.Value, true);
byte? cosPantsState = this.cosPantsState;
this.ChangeCosPantsState(!cosPantsState.HasValue ? ((byte) 0) : cosPantsState.Value, true);
byte? nullable11 = this.cosOptionsState[0];
this.ChangeCosOptionsState(0, !nullable11.HasValue ? ((byte) 0) : nullable11.Value, true);
byte? nullable12 = this.cosOptionsState[1];
this.ChangeCosOptionsState(1, !nullable12.HasValue ? ((byte) 0) : nullable12.Value, true);
byte? cosPanstState = this.cosPanstState;
this.ChangeCosPanstState(!cosPanstState.HasValue ? ((byte) 0) : cosPanstState.Value, true);
byte? cosSocksState = this.cosSocksState;
this.ChangeCosSocksState(!cosSocksState.HasValue ? ((byte) 0) : cosSocksState.Value, true);
byte? cosShoesState = this.cosShoesState;
this.ChangeCosShoesState(!cosShoesState.HasValue ? ((byte) 0) : cosShoesState.Value, true);
int? nipTexType = this.charCustom.nowCCI.nipTexType;
int? nipTexColor = this.charCustom.nowCCI.nipTexColor;
this.charCustom.ChangeTexNip(!nipTexType.HasValue ? 0 : nipTexType.Value, !nipTexColor.HasValue ? 0 : nipTexColor.Value, true);
this.charCustom.ChangeNipShader(this.charCustom.nowCCI.nipAlpha);
int? skinTexColor = this.charCustom.nowCCI.skinTexColor;
this.charCustom.ChangeTexSkin(!skinTexColor.HasValue ? 0 : skinTexColor.Value, true);
int? uhairTexType = this.charCustom.nowCCI.uhairTexType;
this.charCustom.ChangeTexUHair(!uhairTexType.HasValue ? 0 : uhairTexType.Value, true);
this.charCustom.ChangeUHairShader(this.charCustom.nowCCI.uhairColor, this.charCustom.nowCCI.uhairAlpha);
byte? tongueType = this.tongueType;
this.ChangeTongueKind(!tongueType.HasValue ? ((byte) 0) : tongueType.Value, true);
SystemEtcetera.EtcData etcData = Manager.Config.EtcData;
this.charCustom.ChangeTexSkinToon(etcData.data[4], true);
this.customUpdate = true;
}
public void ChangeBodyFromSetting(bool forceChange = true)
{
int? bodyNo = base.bodyNo;
int? panstNo = this.panstNo;
int? socksNo = this.socksNo;
int? shoesNo = this.shoesNo;
this.ChangeBody(!bodyNo.HasValue ? 0 : bodyNo.Value, !panstNo.HasValue ? 0 : panstNo.Value, !socksNo.HasValue ? 6 : socksNo.Value, !shoesNo.HasValue ? 3 : shoesNo.Value, forceChange);
}
public void ChangeBustYureState(bool yure, byte lr)
{
float w = !yure ? 0f : 1f;
foreach (DynamicBone_Custom custom in this.GetRefObject(E_REF_NAME.cf_J_Mune00).GetComponents<DynamicBone_Custom>())
{
if (((lr == 0) || (lr == 2)) && (string.Compare(custom.comment, "BustL") == 0))
{
custom.SetWeight(w);
}
if (((lr == 1) || (lr == 2)) && (string.Compare(custom.comment, "BustR") == 0))
{
custom.SetWeight(w);
}
}
}
public void ChangeCheekAlpha(float alpha)
{
GameObject refObject = this.GetRefObject(E_REF_NAME.cf_O_hohoaka);
if (null != refObject)
{
this.cheekAlpha = alpha;
if ((refObject.renderer != null) && (refObject.renderer.material != null))
{
Color color = refObject.renderer.material.color;
color.a = this.cheekAlpha;
refObject.renderer.material.color = color;
}
}
}
public bool ChangeCosAcsState(E_ACS_KIND kind, byte state, bool forceChange = false)
{
int index = (int) kind;
if (forceChange || (this.cosAcsState[index] != state))
{
this.cosAcsState[index] = new byte?(state);
if (null != this.objAcs[index])
{
Transform child = this.objAcs[index].transform.GetChild(0);
if (null != child)
{
child.gameObject.SetActive(0 == this.cosAcsState[index].Value);
}
}
}
return true;
}
public bool ChangeCosBottomState(byte state, bool forceChange = false)
{
if (forceChange || (this.cosBottomState != state))
{
this.cosBottomState = new byte?(state);
bool[,] flagArray = new bool[,] { { true, true, false, false }, { false, false, true, true }, { false, false, false, false } };
this.ChangeActive(E_REF_NAME.N_bot_a_d, flagArray[this.cosBottomState.Value, 0]);
this.ChangeActive(E_REF_NAME.N_bot_b_d, flagArray[this.cosBottomState.Value, 1]);
this.ChangeActive(E_REF_NAME.N_bot_a_n, flagArray[this.cosBottomState.Value, 2]);
this.ChangeActive(E_REF_NAME.N_bot_b_n, flagArray[this.cosBottomState.Value, 3]);
if (this.BodySubInfo.IsTBSet)
{
if (state == 0)
{
if (this.GetCosTopState() == 2)
{
this.ChangeCosTopState(0, false);
}
}
else if (state == 1)
{
if (this.GetCosTopState() == 2)
{
this.ChangeCosTopState(1, false);
}
}
else
{
this.ChangeCosTopState(2, false);
}
}
}
return true;
}
public bool ChangeCosBottomType(byte type, bool forceChange = false)
{
if (!this.BodySubInfo.Bottom[type])
{
for (byte i = 0; i < 2; i = (byte) (i + 1))
{
if (this.BodySubInfo.Bottom[i])
{
type = i;
break;
}
}
}
if (forceChange || (this.cosBottomType != type))
{
this.cosBottomType = new byte?(type);
bool[] flagArray1 = new bool[2, 2];
flagArray1[0, 0] = true;
flagArray1[1, 1] = true;
bool[,] flagArray = flagArray1;
this.ChangeActive(E_REF_NAME.N_bottoms_a, flagArray[this.cosBottomType.Value, 0]);
this.ChangeActive(E_REF_NAME.N_bottoms_b, flagArray[this.cosBottomType.Value, 1]);
GameObject refObject = this.GetRefObject(E_REF_NAME.cf_J_sk_top_dam);
if ((type == 0) && this.BodySubInfo.IsDBSkirt)
{
refObject.SetActive(true);
}
else if ((type == 1) && this.BodySubInfo.IsDBZubon)
{
refObject.SetActive(true);
}
else
{
refObject.SetActive(false);
}
}
return true;
}
public bool ChangeCosBuraState(byte state, bool forceChange = false)
{
if (forceChange || (this.cosBuraState != state))
{
this.cosBuraState = new byte?(state);
bool[,] flagArray = new bool[,] {
true, true, true, false, false, false, false, false, false, true, true, true, false, false, false, false,
false, false, false, false
};
this.ChangeActive(E_REF_NAME.cf_O_bra_a_d, flagArray[this.cosBuraState.Value, 0]);
this.ChangeActive(E_REF_NAME.cf_O_bra_b_d, flagArray[this.cosBuraState.Value, 1]);
this.ChangeActive(E_REF_NAME.cf_O_bra_c_d, flagArray[this.cosBuraState.Value, 2]);
this.ChangeActive(E_REF_NAME.cf_O_bra_a_n, flagArray[this.cosBuraState.Value, 3]);
this.ChangeActive(E_REF_NAME.cf_O_bra_b_n, flagArray[this.cosBuraState.Value, 4]);
this.ChangeActive(E_REF_NAME.cf_O_bra_c_n, flagArray[this.cosBuraState.Value, 5]);
}
return true;
}
public bool ChangeCosOptionsState(int id, byte state, bool forceChange = false)
{
if (forceChange || (this.cosOptionsState[id] != state))
{
this.cosOptionsState[id] = new byte?(state);
E_REF_NAME[] e_ref_nameArray = new E_REF_NAME[] { E_REF_NAME.N_option1, E_REF_NAME.N_option2 };
this.ChangeActive(e_ref_nameArray[id], 0 == this.cosOptionsState[id].Value);
}
return true;
}
public bool ChangeCosPanstState(byte state, bool forceChange = false)
{
if (forceChange || (this.cosPanstState != state))
{
this.cosPanstState = new byte?(state);
bool[] flagArray1 = new bool[3, 2];
flagArray1[0, 0] = true;
flagArray1[1, 1] = true;
bool[,] flagArray = flagArray1;
this.ChangeActive(E_REF_NAME.N_panst_d, flagArray[this.cosPanstState.Value, 0]);
this.ChangeActive(E_REF_NAME.N_panst_n, flagArray[this.cosPanstState.Value, 1]);
}
return true;
}
public bool ChangeCosPantsState(byte state, bool forceChange = false)
{
if (forceChange || (this.cosPantsState != state))
{
this.cosPantsState = new byte?(state);
bool[] flagArray1 = new bool[3, 2];
flagArray1[0, 0] = true;
flagArray1[1, 1] = true;
bool[,] flagArray = flagArray1;
this.ChangeActive(E_REF_NAME.cf_O_shorts_d, flagArray[this.cosPantsState.Value, 0]);
this.ChangeActive(E_REF_NAME.cf_O_shorts_n, flagArray[this.cosPantsState.Value, 1]);
}
return true;
}
public bool ChangeCosShoesState(byte state, bool forceChange = false)
{
if (forceChange || (this.cosShoesState != state))
{
this.cosShoesState = new byte?(state);
this.ChangeActive(E_REF_NAME.N_cf_shoes, 0 == this.cosShoesState.Value);
}
return true;
}
public bool ChangeCosSocksState(byte state, bool forceChange = false)
{
if (forceChange || (this.cosSocksState != state))
{
this.cosSocksState = new byte?(state);
this.ChangeActive(E_REF_NAME.N_cf_socks, 0 == this.cosSocksState.Value);
}
return true;
}
public bool ChangeCosSodeType(byte type, bool forceChange = false)
{
if (!this.BodySubInfo.Sode[type])
{
for (byte i = 0; i < 3; i = (byte) (i + 1))
{
if (this.BodySubInfo.Sode[i])
{
type = i;
break;
}
}
}
if (forceChange || (this.cosSodeType != type))
{
this.cosSodeType = new byte?(type);
bool[] flagArray1 = new bool[3, 3];
flagArray1[0, 0] = true;
flagArray1[1, 1] = true;
flagArray1[2, 2] = true;
bool[,] flagArray = flagArray1;
this.ChangeActive(E_REF_NAME.N_sode01, flagArray[this.cosSodeType.Value, 0]);
this.ChangeActive(E_REF_NAME.N_sode02, flagArray[this.cosSodeType.Value, 1]);
this.ChangeActive(E_REF_NAME.N_sode03, flagArray[this.cosSodeType.Value, 2]);
}
return true;
}
public bool ChangeCosStateAll(byte state)
{
byte[,] buffer = new byte[,] {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 0, 0
};
this.ChangeCosTopState(buffer[state, 0], false);
this.ChangeCosBottomState(buffer[state, 1], false);
this.ChangeCosBuraState(buffer[state, 2], false);
this.ChangeCosPantsState(buffer[state, 3], false);
this.ChangeCosPanstState(buffer[state, 4], false);
this.ChangeCosSocksState(buffer[state, 5], false);
this.ChangeCosShoesState(buffer[state, 6], false);
for (int i = 0; i < this.cosAcsState.Length; i++)
{
this.ChangeCosAcsState((E_ACS_KIND) i, buffer[state, 7 + i], false);
}
for (int j = 0; j < this.cosOptionsState.Length; j++)
{
this.ChangeCosOptionsState(j, buffer[state, 0x10 + j], false);
}
return true;
}
public bool ChangeCosTopState(byte state, bool forceChange = false)
{
if (forceChange || (this.cosTopState != state))
{
this.cosTopState = new byte?(state);
bool[,] flagArray = new bool[,] {
true, true, false, false, false, false, true, false, false, true, true, false, false, true, false, false,
false, false, true, true, false, false, false, false
};
this.ChangeActive(E_REF_NAME.N_tops_a, flagArray[this.cosTopState.Value, 0]);
this.ChangeActive(E_REF_NAME.N_bra_a, flagArray[this.cosTopState.Value, 1]);
this.ChangeActive(E_REF_NAME.N_tops_b, flagArray[this.cosTopState.Value, 2]);
this.ChangeActive(E_REF_NAME.N_bra_b, flagArray[this.cosTopState.Value, 3]);
this.ChangeActive(E_REF_NAME.N_tops_c, flagArray[this.cosTopState.Value, 4]);
this.ChangeActive(E_REF_NAME.N_bra_c, flagArray[this.cosTopState.Value, 5]);
this.ChangeActive(E_REF_NAME.N_sode, flagArray[this.cosTopState.Value, 6]);
if (this.BodySubInfo.IsTBSet)
{
if (state == 0)
{
if (this.GetCosBottomState() == 2)
{
this.ChangeCosBottomState(0, false);
}
}
else if (state == 1)
{
if (this.GetCosBottomState() == 2)
{
this.ChangeCosBottomState(1, false);
}
}
else
{
this.ChangeCosBottomState(2, false);
}
}
}
return true;
}
public override void ChangeEyeblowOpen(float value)
{
if (this.EyebrowCtrl != null)
{
this.EyebrowCtrl.OpenMax = Mathf.Clamp(value, 0f, 1f);
}
}
public override void ChangeEyeblowPtn(int ptn, bool blend = true)
{
if (this.EyebrowCtrl != null)
{
this.ptnBsEyeblow = ptn;
this.EyebrowCtrl.ChangePtn(ptn, blend);
}
}
public override void ChangeEyesOpen(float value)
{
if (this.EyesCtrl != null)
{
this.EyesCtrl.OpenMax = Mathf.Clamp(value, 0f, 1f);
}
}
public override void ChangeEyesPtn(int ptn, bool blend = true)
{
if (this.EyesCtrl != null)
{
this.ptnBsEyes = ptn;
this.EyesCtrl.ChangePtn(ptn, blend);
}
}
public void ChangeHair(int _hairFNo = -1, int _hairBNo = -1, int _hairSNo = -1, int _hairONo = -1, bool forceChange = false)
{
if (forceChange)
{
if (_hairFNo != -1)
{
this.charCustom.nowCCI.hairFNo = -2;
}
if (_hairBNo != -1)
{
this.charCustom.nowCCI.hairBNo = -2;
}
if (_hairSNo != -1)
{
this.charCustom.nowCCI.hairSNo = -2;
}
if (_hairONo != -1)
{
this.charCustom.nowCCI.hairONo = -2;
}
}
else
{
if ((_hairFNo != -1) && (null == this.objHairF))
{
this.charCustom.nowCCI.hairFNo = -2;
}
if ((_hairBNo != -1) && (null == this.objHairB))
{
this.charCustom.nowCCI.hairBNo = -2;
}
if ((_hairSNo != -1) && (null == this.objHairS))
{
this.charCustom.nowCCI.hairSNo = -2;
}
if ((_hairONo != -1) && (null == this.objHairO))
{
this.charCustom.nowCCI.hairONo = -2;
}
}
GameObject refObject = this.GetRefObject(E_REF_NAME.cf_J_Head_s);
if ((_hairFNo != -1) && (_hairFNo != this.charCustom.nowCCI.hairFNo))
{
if (this.objHairF != null)
{
CommonAssist.Destroy(ref this.objHairF);
}
Dictionary<int, ListTypeChara> charaObjList = base.listInfo.GetCharaObjList(ListInfo.EInfoType.ELI_F_HairF, true);
if (!charaObjList.ContainsKey(_hairFNo))
{
_hairFNo = 0;
}
this.objHairF = CommonAssist.LoadCloneFromAssetBundle(charaObjList[_hairFNo].ABName, charaObjList[_hairFNo].PName, "cf_hairF", base.objTop);
if ((null != this.objHairF) && (refObject != null))
{
this.objHairF.transform.parent = refObject.transform;
this.objHairF.transform.SetLocalPosition(0f, 0f, 0f);
this.objHairF.transform.SetLocalRotation(0f, 0f, 0f);
}
this.charCustom.nowCCI.hairFNo = new int?(_hairFNo);
this.listMeshHairF.Clear();
this.objHairF.transform.FindLoopPrefix(this.listMeshHairF, "hf");
this.charCustom.ChangeHairShader(0);
this.SetDBHairCollision(this.objHairF);
}
if ((_hairBNo != -1) && (_hairBNo != this.charCustom.nowCCI.hairBNo))
{
if (this.objHairB != null)
{
CommonAssist.Destroy(ref this.objHairB);
}
Dictionary<int, ListTypeChara> dictionary2 = base.listInfo.GetCharaObjList(ListInfo.EInfoType.ELI_F_HairB, true);
if (!dictionary2.ContainsKey(_hairBNo))
{
_hairBNo = 0;
}
this.objHairB = CommonAssist.LoadCloneFromAssetBundle(dictionary2[_hairBNo].ABName, dictionary2[_hairBNo].PName, "cf_hairB", base.objTop);
if ((null != this.objHairB) && (refObject != null))
{
this.objHairB.transform.parent = refObject.transform;
this.objHairB.transform.SetLocalPosition(0f, 0f, 0f);
this.objHairB.transform.SetLocalRotation(0f, 0f, 0f);
}
this.charCustom.nowCCI.hairBNo = new int?(_hairBNo);
this.listMeshHairB.Clear();
this.objHairB.transform.FindLoopPrefix(this.listMeshHairB, "hb");
this.charCustom.ChangeHairShader(1);
this.SetDBHairCollision(this.objHairB);
}
if ((_hairSNo != -1) && (_hairSNo != this.charCustom.nowCCI.hairSNo))
{
if (this.objHairS != null)
{
CommonAssist.Destroy(ref this.objHairS);
}
Dictionary<int, ListTypeChara> dictionary3 = base.listInfo.GetCharaObjList(ListInfo.EInfoType.ELI_F_HairS, true);
if (!dictionary3.ContainsKey(_hairSNo))
{
_hairSNo = 0;
}
this.objHairS = CommonAssist.LoadCloneFromAssetBundle(dictionary3[_hairSNo].ABName, dictionary3[_hairSNo].PName, "cf_hairS", base.objTop);
if ((null != this.objHairS) && (refObject != null))
{
this.objHairS.transform.parent = refObject.transform;
this.objHairS.transform.SetLocalPosition(0f, 0f, 0f);
this.objHairS.transform.SetLocalRotation(0f, 0f, 0f);
}
this.charCustom.nowCCI.hairSNo = new int?(_hairSNo);
this.listMeshHairS.Clear();
this.objHairS.transform.FindLoopPrefix(this.listMeshHairS, "hs");
this.charCustom.ChangeHairShader(2);
this.SetDBHairCollision(this.objHairS);
}
if ((_hairONo != -1) && (_hairONo != this.charCustom.nowCCI.hairONo))
{
if (this.objHairO != null)
{
CommonAssist.Destroy(ref this.objHairO);
}
Dictionary<int, ListTypeChara> dictionary4 = base.listInfo.GetCharaObjList(ListInfo.EInfoType.ELI_F_HairO, true);
if (!dictionary4.ContainsKey(_hairONo))
{
_hairONo = 0;
}
this.objHairO = CommonAssist.LoadCloneFromAssetBundle(dictionary4[_hairONo].ABName, dictionary4[_hairONo].PName, "cf_hairO", base.objTop);
if ((null != this.objHairO) && (refObject != null))
{
this.objHairO.transform.parent = refObject.transform;
this.objHairO.transform.SetLocalPosition(0f, 0f, 0f);
this.objHairO.transform.SetLocalRotation(0f, 0f, 0f);
}
this.charCustom.nowCCI.hairONo = new int?(_hairONo);
this.listMeshHairO.Clear();
this.objHairO.transform.FindLoopPrefix(this.listMeshHairO, "ho");
this.charCustom.ChangeHairShader(3);
this.SetDBHairCollision(this.objHairO);
}
}
public void ChangeHairFromSetting(bool forceChange = true)
{
int[] numArray = new int[4];
if ((this.charCustom != null) && (this.charCustom.nowCCI != null))
{
int? hairFNo = this.charCustom.nowCCI.hairFNo;
numArray[0] = !hairFNo.HasValue ? 4 : hairFNo.Value;
int? hairBNo = this.charCustom.nowCCI.hairBNo;
numArray[1] = !hairBNo.HasValue ? 3 : hairBNo.Value;
int? hairSNo = this.charCustom.nowCCI.hairSNo;
numArray[2] = !hairSNo.HasValue ? 0 : hairSNo.Value;
int? hairONo = this.charCustom.nowCCI.hairONo;
numArray[3] = !hairONo.HasValue ? 0 : hairONo.Value;
}
this.ChangeHair(numArray[0], numArray[1], numArray[2], numArray[3], forceChange);
}
public void ChangeHead(int _headNo = -1, int _eyelineNo = -1, bool forceChange = false)
{
if (forceChange)
{
if (_headNo != -1)
{
base.headNo = -2;
}
if (_eyelineNo != -1)
{
this.charCustom.nowCCI.eyelineNo = -2;
}
}
else
{
if ((_headNo != -1) && (null == base.objHead))
{
base.headNo = -2;
}
if ((_eyelineNo != -1) && (null == this.objEyeline))
{
this.charCustom.nowCCI.eyelineNo = -2;
}
}
GameObject refObject = this.GetRefObject(E_REF_NAME.cf_J_Head_s);
if ((_headNo != -1) && (_headNo != base.headNo))
{
if (base.objHead != null)
{
this.eyeScaleInfo.Release();
CommonAssist.Destroy(ref this.objHead);
}
Dictionary<int, ListTypeChara> charaObjList = base.listInfo.GetCharaObjList(ListInfo.EInfoType.ELI_F_Face, true);
if (!charaObjList.ContainsKey(_headNo))
{
_headNo = 0;
}
string str = string.Empty;
base.objHead = CommonAssist.LoadCloneFromAssetBundle(charaObjList[_headNo].ABName, charaObjList[_headNo].PName, "cf_head", base.objTop);
if (null != base.objHead)
{
if (refObject != null)
{
base.objHead.transform.parent = refObject.transform;
base.objHead.transform.SetLocalPosition(0f, 0f, 0f);
base.objHead.transform.SetLocalRotation(0f, 0f, 0f);
}
GameObject obj3 = base.objHead.transform.FindLoop("EyeLookControl");
if (obj3 != null)
{
EyeLookCalc component = obj3.GetComponent<EyeLookCalc>();
if (component != null)
{
component.Init();
}
this.eyeLookCtrl = obj3.GetComponent<EyeLookController>();
if (this.eyeLookCtrl != null)
{
this.ChangeLookEyesTarget(this.GetLookTargetE(), null, 1f);
}
}
this.fbsCtrlHead = base.objHead.GetComponent<FaceBlendShape>();
if (null != this.fbsCtrlHead)
{
this.fbsCtrlHead.SetBlinkControlEx(this.blinkCtrl);
this.EyebrowCtrl = this.fbsCtrlHead.EyebrowCtrl;
this.MouthCtrl = this.fbsCtrlHead.MouthCtrl;
}
this.eyeScaleInfo.LoadUVData(charaObjList[_headNo].ABName, this.female_dir + str + charaObjList[_headNo].PName + "_UV");
this.eyeScaleInfo.InitTargetObj(base.objHead);
}
base.headNo = new int?(_headNo);
this.siruLv[0] = 0;
}
if ((_eyelineNo != -1) && (_eyelineNo != this.charCustom.nowCCI.eyelineNo))
{
if (this.objEyeline != null)
{
CommonAssist.Destroy(ref this.objEyeline);
}
Dictionary<int, ListTypeChara> dictionary2 = base.listInfo.GetCharaObjList(ListInfo.EInfoType.ELI_F_Eyeline, true);
if (!dictionary2.ContainsKey(_eyelineNo))
{
_eyelineNo = 0;
}
this.objEyeline = CommonAssist.LoadCloneFromAssetBundle(dictionary2[_eyelineNo].ABName, dictionary2[_eyelineNo].PName, "cf_eyeline", base.objTop);
if (null != this.objEyeline)
{
if (refObject != null)
{
this.objEyeline.transform.parent = refObject.transform;
this.objEyeline.transform.SetLocalPosition(0f, 0f, 0f);
this.objEyeline.transform.SetLocalRotation(0f, 0f, 0f);
}
this.fbsCtrlELine = this.objEyeline.GetComponent<FaceBlendShape>();
if (null != this.fbsCtrlELine)
{
this.fbsCtrlELine.SetBlinkControlEx(this.blinkCtrl);
this.EyesCtrl = this.fbsCtrlELine.EyesCtrl;
}
}
this.charCustom.nowCCI.eyelineNo = new int?(_eyelineNo);
}
this.InitRefObject(4);
this.GetMeshInFaceFromTag();
this.GetMeshInEyelineFromTag();
byte? tongueType = this.tongueType;
this.ChangeTongueKind(!tongueType.HasValue ? ((byte) 0) : tongueType.Value, true);
this.ChangeCheekAlpha(this.cheekAlpha);
int? skinTexColor = this.charCustom.nowCCI.skinTexColor;
this.charCustom.ChangeTexSkin(!skinTexColor.HasValue ? 0 : skinTexColor.Value, true);
int? eyeblowTexType = this.charCustom.nowCCI.eyeblowTexType;
this.charCustom.ChangeTexEyeBlow(!eyeblowTexType.HasValue ? 0 : eyeblowTexType.Value, true);
this.charCustom.ChangeEyeblowShader(this.charCustom.nowCCI.eyeblowColor);
int? eyeTexType = this.charCustom.nowCCI.eyeTexType;
this.charCustom.ChangeTexEye(!eyeTexType.HasValue ? 0 : eyeTexType.Value, true);
for (int i = 0; i < 2; i++)
{
this.charCustom.ChangeEyeShader((byte) i, this.charCustom.nowCCI.eyeColor[i]);
}
int? eyeHiTexType = this.charCustom.nowCCI.eyeHiTexType;
this.charCustom.ChangeTexEyeHi(!eyeHiTexType.HasValue ? 0 : eyeHiTexType.Value, true);
this.charCustom.ChangeLipShader(this.charCustom.nowCCI.lipColor, this.charCustom.nowCCI.lipAlpha);
SystemEtcetera.EtcData etcData = Manager.Config.EtcData;
this.charCustom.ChangeTexSkinToon(etcData.data[4], true);
this.customUpdate = true;
if (((null != this.objEyeline) && (null != base.objHead)) && (null != this.fbsCtrlELine))
{
this.fbsCtrlELine.EyeLookController = this.eyeLookCtrl;
}
}
public void ChangeHeadFromSetting(bool forceChange = true)
{
int num = 0;
if ((this.charCustom != null) && (this.charCustom.nowCCI != null))
{
int? eyelineNo = this.charCustom.nowCCI.eyelineNo;
num = !eyelineNo.HasValue ? 0 : eyelineNo.Value;
}
int? headNo = base.headNo;
this.ChangeHead(!headNo.HasValue ? 0 : headNo.Value, num, forceChange);
}
public override void ChangeLookEyesPtn(int ptn, bool ForceChange = false)
{
if (null != this.eyeLookCtrl)
{
this.eyeLookCtrl.ptnNo = ptn;
}
}
public override void ChangeLookEyesTarget(int targetNo, GameObject target = null, float rate = 1f)
{
if (null != this.eyeLookCtrl)
{
this.lookTargetE = targetNo;
if (targetNo == 0)
{
if (Camera.main != null)
{
this.eyeLookCtrl.target = Camera.main.transform;
}
else
{
this.eyeLookCtrl.target = null;
}
}
else
{
this.eyeLookCtrl.target = (null != target) ? target.transform : null;
}
}
}
public override void ChangeLookNeckPtn(int ptn, bool ForceChange = false)
{
if (null != this.neckLookCtrl)
{
this.neckLookCtrl.ptnNo = ptn;
}
}
public override void ChangeLookNeckTarget(int targetNo, GameObject target = null, float rate = 1f)
{
if (null != this.neckLookCtrl)
{
this.lookTargetN = targetNo;
if (targetNo == 0)
{
if (Camera.main != null)
{
this.neckLookCtrl.target = Camera.main.transform;
}
else
{
this.neckLookCtrl.target = null;
}
}
else
{
this.neckLookCtrl.target = (null != target) ? target.transform : null;
}
}
}
public override void ChangeMouthOpen(float value)
{
if (this.MouthCtrl != null)
{
this.MouthCtrl.OpenMax = Mathf.Clamp(value, 0f, 1f);
}
}
public override void ChangeMouthPtn(int ptn, bool blend = true, bool limit = true)
{
if (this.MouthCtrl != null)
{
this.ptnBsMouth = ptn;
this.MouthCtrl.ChangePtn(ptn, blend);
if (limit)
{
if ((ptn == 13) || (ptn == 14))
{
this.ChangeTongueKind(1, false);
}
else
{
this.ChangeTongueKind(0, false);
}
}
}
}
public bool ChangeTongueKind(byte type, bool forceChange = false)
{
if (forceChange || (this.tongueType != type))
{
if ((null == this.GetRefObject(E_REF_NAME.cf_O_sitamof)) || (null == this.GetRefObject(E_REF_NAME.cf_O_tang)))
{
return false;
}
this.tongueType = new byte?(type);
bool[] flagArray1 = new bool[2, 2];
flagArray1[0, 0] = true;
flagArray1[1, 1] = true;
bool[,] flagArray = flagArray1;
this.ChangeActive(E_REF_NAME.cf_O_sitamof, flagArray[this.tongueType.Value, 0]);
this.ChangeActive(E_REF_NAME.cf_O_tang, flagArray[this.tongueType.Value, 1]);
}
return true;
}
public void CShadowProc()
{
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) };
base.CShadowProcBase(objShadowTarg);
}
public int GetAcsNo(E_ACS_KIND kind)
{
int? nullable = this.acsNo[(int) kind];
return (!nullable.HasValue ? 0 : nullable.Value);
}
public bool GetBlinkFlag()
{
return ((this.blinkCtrl != null) && (this.blinkCtrl.GetFixedFlags() == 0));
}
public int GetCharaNo()
{
return this.charaNo;
}
public float GetCheekAlpha()
{
return this.cheekAlpha;
}
public byte GetCosAcsState(E_ACS_KIND kind)
{
byte? nullable = this.cosAcsState[(int) kind];
return (!nullable.HasValue ? ((byte) 0) : nullable.Value);
}
public byte GetCosBottomState()
{
byte? cosBottomState = this.cosBottomState;
return (!cosBottomState.HasValue ? ((byte) 0) : cosBottomState.Value);
}
public byte GetCosBottomType()
{
byte? cosBottomType = this.cosBottomType;
return (!cosBottomType.HasValue ? ((byte) 0) : cosBottomType.Value);
}
public byte GetCosBuraState()
{
byte? cosBuraState = this.cosBuraState;
return (!cosBuraState.HasValue ? ((byte) 0) : cosBuraState.Value);
}
public CosCustom GetCosCustomInstance()
{
return this.cosCustom;
}
public byte GetCosOptionState(int id)
{
byte? nullable = this.cosOptionsState[id];
return (!nullable.HasValue ? ((byte) 0) : nullable.Value);
}
public byte GetCosPanstState()
{
byte? cosPanstState = this.cosPanstState;
return (!cosPanstState.HasValue ? ((byte) 0) : cosPanstState.Value);
}
public byte GetCosPantsState()
{
byte? cosPantsState = this.cosPantsState;
return (!cosPantsState.HasValue ? ((byte) 0) : cosPantsState.Value);
}
public byte GetCosShoesState()
{
byte? cosShoesState = this.cosShoesState;
return (!cosShoesState.HasValue ? ((byte) 0) : cosShoesState.Value);
}
public byte GetCosSocksState()
{
byte? cosSocksState = this.cosSocksState;
return (!cosSocksState.HasValue ? ((byte) 0) : cosSocksState.Value);
}
public byte GetCosSodeType()
{
byte? cosSodeType = this.cosSodeType;
return (!cosSodeType.HasValue ? ((byte) 0) : cosSodeType.Value);
}
public byte GetCosTopState()
{
byte? cosTopState = this.cosTopState;
return (!cosTopState.HasValue ? ((byte) 0) : cosTopState.Value);
}
public CharCustom GetCustomInstance()
{
return this.charCustom;
}
public FBSCtrlEyebrow GetEyeBlowCtrl()
{
return this.EyebrowCtrl;
}
public int GetEyeblowPtn()
{
return this.ptnBsEyeblow;
}
public FBSCtrlEyes GetEyesCtrl()
{
return this.EyesCtrl;
}
public bool GetEyesHi()
{
return this.eyesHi;
}
public int GetEyesPtn()
{
return this.ptnBsEyes;
}
public List<GameObject> GetListMeshHairB()
{
return this.listMeshHairB;
}
public List<GameObject> GetListMeshHairF()
{
return this.listMeshHairF;
}
public List<GameObject> GetListMeshHairO()
{
return this.listMeshHairO;
}
public List<GameObject> GetListMeshHairS()
{
return this.listMeshHairS;
}
public List<GameObject> GetListTagColHair()
{
return this.listTagColHair;
}
public List<GameObject> GetListTagEyeblow()
{
return this.listTagEyeblow;
}
public List<GameObject> GetListTagEyeHi()
{
return this.listTagEyeHi;
}
public List<GameObject> GetListTagEyeL()
{
return this.listTagEyeL;
}
public List<GameObject> GetListTagEyeline()
{
return this.listTagEyeline;
}
public List<GameObject> GetListTagEyeR()
{
return this.listTagEyeR;
}
public List<GameObject> GetListTagNail()
{
return this.listTagNail;
}
public List<GameObject> GetListTagNip()
{
return this.listTagNip;
}
public List<GameObject> GetListTagSkinB()
{
return this.listTagSkinB;
}
public List<GameObject> GetListTagSkinE()
{
return this.listTagSkinE;
}
public List<GameObject> GetListTagSkinF()
{
return this.listTagSkinF;
}
public List<GameObject> GetListTagUHair()
{
return this.listTagUHair;
}
public int GetLookEyesPtn()
{
if (null == this.eyeLookCtrl)
{
return 0;
}
return this.eyeLookCtrl.ptnNo;
}
public int GetLookNeckPtn()
{
if (null == this.neckLookCtrl)
{
return 0;
}
return this.neckLookCtrl.ptnNo;
}
public int GetLookTargetE()
{
return this.lookTargetE;
}
public int GetLookTargetN()
{
return this.lookTargetN;
}
public void GetMeshInBodyFromTag()
{
this.listTagSkinB.Clear();
this.listTagNip.Clear();
this.listTagUHair.Clear();
this.listTagNail.Clear();
if (base.objBody != null)
{
base.objBody.transform.FindLoopTag(this.listTagSkinB, "TexSkinBody");
base.objBody.transform.FindLoopTag(this.listTagNip, "TexNip");
base.objBody.transform.FindLoopTag(this.listTagUHair, "TexUnderHair");
base.objBody.transform.FindLoopTag(this.listTagNail, "TexNail");
}
}
public void GetMeshInEyelineFromTag()
{
this.listTagEyeline.Clear();
this.listTagSkinE.Clear();
if (this.objEyeline != null)
{
this.objEyeline.transform.FindLoopTag(this.listTagEyeline, "TexEyeline");
this.objEyeline.transform.FindLoopTag(this.listTagSkinE, "TexSkinEyeline");
}
}
public void GetMeshInFaceFromTag()
{
this.listTagEyeblow.Clear();
this.listTagEyeL.Clear();
this.listTagEyeR.Clear();
this.listTagEyeHi.Clear();
this.listTagSkinF.Clear();
if (base.objHead != null)
{
base.objHead.transform.FindLoopTag(this.listTagEyeblow, "TexEyeblow");
base.objHead.transform.FindLoopTag(this.listTagEyeL, "TexEyeL");
base.objHead.transform.FindLoopTag(this.listTagEyeR, "TexEyeR");
base.objHead.transform.FindLoopTag(this.listTagEyeHi, "TexEyeHi");
base.objHead.transform.FindLoopTag(this.listTagSkinF, "TexSkinFace");
}
}
public FBSCtrlMouth GetMouthCtrl()
{
return this.MouthCtrl;
}
public int GetMouthPtn()
{
return this.ptnBsMouth;
}
public Quaternion GetNeckFixAngle()
{
if (null == this.neckLookCtrl)
{
return new Quaternion(0f, 0f, 0f, 1f);
}
return this.neckLookCtrl.neckLookScript.fixAngle;
}
public int GetPanstNo()
{
int? panstNo = this.panstNo;
return (!panstNo.HasValue ? 0 : panstNo.Value);
}
public GameObject GetRefObject(E_REF_NAME nameID)
{
if (!this.dictRefObj.ContainsKey(nameID))
{
return null;
}
return this.dictRefObj[nameID];
}
public int GetShoesNo()
{
int? shoesNo = this.shoesNo;
return (!shoesNo.HasValue ? 0 : shoesNo.Value);
}
public int GetSocksNo()
{
int? socksNo = this.socksNo;
return (!socksNo.HasValue ? 0 : socksNo.Value);
}
public FemaleHStatus GetStatusInstance()
{
return this.status;
}
public byte GetTongueKind()
{
byte? tongueType = this.tongueType;
return (!tongueType.HasValue ? ((byte) 0) : tongueType.Value);
}
public override void Init(ListInfo _listInfo, GameObject parent, string topName, int id, string assetPath, string resourcesDir, string loadfilename = "", bool rand = false, bool studio = false)
{
this.charCustom = new CharCustom();
this.charCustom.Init(this, _listInfo);
this.cosCustom = new CosCustom();
this.cosCustom.Init(this, _listInfo);
base.objTop = new GameObject(topName);
base.objTop.transform.parent = parent.transform;
this.status = base.objTop.AddComponent<FemaleHStatus>();
base.listInfo = _listInfo;
base.idNo = id;
if (rand)
{
this.cosCustom.RandCosAll();
this.charCustom.RandCustomAll(false, string.Empty);
}
else if (string.Compare(string.Empty, loadfilename) != 0)
{
if ((string.Compare(string.Empty, assetPath) == 0) || (string.Compare(string.Empty, resourcesDir) == 0))
{
this.LoadCharaData(loadfilename, 0);
}
else
{
char[] separator = new char[] { '_' };
string[] strArray = loadfilename.Split(separator);
string filename = string.Empty;
string key = strArray[0];
if (key != null)
{
int num;
if (<>f__switch$map6 == null)
{
Dictionary<string, int> dictionary = new Dictionary<string, int>(5);
dictionary.Add("kyoka", 0);
dictionary.Add("jyujyu", 1);
dictionary.Add("azusa", 2);
dictionary.Add("ayaka", 3);
dictionary.Add("sizuka", 4);
<>f__switch$map6 = dictionary;
}
if (<>f__switch$map6.TryGetValue(key, out num))
{
switch (num)
{
case 0:
filename = "IbukiKyoka.png";
break;
case 1:
filename = "AkihaJyujyu.png";
break;
case 2:
filename = "SaekiAzusa.png";
break;
case 3:
filename = "MayuzumiAyaka.png";
break;
case 4:
filename = "TsukuyomiSizuka.png";
break;
}
}
}
if (!this.LoadCharaData(filename, 0))
{
}
this.cosCustom.LoadCosFavorite(loadfilename, assetPath, resourcesDir, 0);
}
}
string file = !studio ? "p_cf_joint" : "p_cf_joint_studio";
if (studio)
{
base.objBone = CommonAssist.LoadCloneFromAssetBundle("chara/cf_base_studio.unity3d", file, "cf_base", base.objTop);
}
else
{
base.objBone = CommonAssist.LoadCloneFromAssetBundle("chara/cf_base.unity3d", file, "cf_base", base.objTop);
}
this.InitRefObject(1);
if (base.objBone != null)
{
base.aaWeights.CreateBoneList(base.objBone, "cf_J");
base.GetShadowObj();
GameObject refObject = this.GetRefObject(E_REF_NAME.cf_J_Neck);
if (refObject != null)
{
this.neckLookCtrl = refObject.GetComponent<NeckLookController>();
if (this.neckLookCtrl != null)
{
this.ChangeLookNeckTarget(this.GetLookTargetN(), null, 1f);
}
}
this.listTagColHair.Clear();
base.objBone.transform.FindLoopTag(this.listTagColHair, "ColHair");
}
this.ChangeBodyFromSetting(true);
this.ChangeHeadFromSetting(true);
this.ChangeHairFromSetting(true);
this.ChangeAccessoryFromSetting(true);
this.ChangeLookEyesTarget(0, null, 1f);
this.ChangeLookEyesPtn(1, false);
this.ChangeLookNeckTarget(0, null, 1f);
this.ChangeLookNeckPtn(1, false);
}
public override void InitRefObject(int flags)
{
if ((flags & 1) != 0)
{
this.dictRefObj[E_REF_NAME.cf_J_Head_s] = base.objBone.transform.FindLoop(E_REF_NAME.cf_J_Head_s.ToString());
this.dictRefObj[E_REF_NAME.NP_cf_acs_back] = base.objBone.transform.FindLoop(E_REF_NAME.NP_cf_acs_back.ToString());
this.dictRefObj[E_REF_NAME.NP_cf_acs_waist] = base.objBone.transform.FindLoop(E_REF_NAME.NP_cf_acs_waist.ToString());
this.dictRefObj[E_REF_NAME.NP_cf_acs_wrist_l] = base.objBone.transform.FindLoop(E_REF_NAME.NP_cf_acs_wrist_l.ToString());
this.dictRefObj[E_REF_NAME.NP_cf_acs_wrist_r] = base.objBone.transform.FindLoop(E_REF_NAME.NP_cf_acs_wrist_r.ToString());
this.dictRefObj[E_REF_NAME.NP_cf_acs_neck] = base.objBone.transform.FindLoop(E_REF_NAME.NP_cf_acs_neck.ToString());
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());
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());
this.dictRefObj[E_REF_NAME.cf_J_sk_top_dam] = base.objBone.transform.FindLoop(E_REF_NAME.cf_J_sk_top_dam.ToString());
this.dictRefObj[E_REF_NAME.cf_J_ArmUp00_L] = base.objBone.transform.FindLoop(E_REF_NAME.cf_J_ArmUp00_L.ToString());
this.dictRefObj[E_REF_NAME.cf_J_ArmUp00_R] = base.objBone.transform.FindLoop(E_REF_NAME.cf_J_ArmUp00_R.ToString());
this.dictRefObj[E_REF_NAME.cf_J_LegUp02_L] = base.objBone.transform.FindLoop(E_REF_NAME.cf_J_LegUp02_L.ToString());
this.dictRefObj[E_REF_NAME.cf_J_LegUp02_R] = base.objBone.transform.FindLoop(E_REF_NAME.cf_J_LegUp02_R.ToString());
this.dictRefObj[E_REF_NAME.cf_J_Hips] = base.objBone.transform.FindLoop(E_REF_NAME.cf_J_Hips.ToString());
this.dictRefObj[E_REF_NAME.cf_J_Mune00] = base.objBone.transform.FindLoop(E_REF_NAME.cf_J_Mune00.ToString());
this.dictRefObj[E_REF_NAME.cf_J_Neck] = base.objBone.transform.FindLoop(E_REF_NAME.cf_J_Neck.ToString());
}
if ((flags & 2) != 0)
{
this.dictRefObj[E_REF_NAME.N_bottoms_a] = base.objBody.transform.FindLoop(E_REF_NAME.N_bottoms_a.ToString());
this.dictRefObj[E_REF_NAME.N_bottoms_b] = base.objBody.transform.FindLoop(E_REF_NAME.N_bottoms_b.ToString());
this.dictRefObj[E_REF_NAME.N_tops_a] = base.objBody.transform.FindLoop(E_REF_NAME.N_tops_a.ToString());
this.dictRefObj[E_REF_NAME.N_tops_b] = base.objBody.transform.FindLoop(E_REF_NAME.N_tops_b.ToString());
this.dictRefObj[E_REF_NAME.N_tops_c] = base.objBody.transform.FindLoop(E_REF_NAME.N_tops_c.ToString());
this.dictRefObj[E_REF_NAME.N_bot_a_d] = base.objBody.transform.FindLoop(E_REF_NAME.N_bot_a_d.ToString());
this.dictRefObj[E_REF_NAME.N_bot_a_n] = base.objBody.transform.FindLoop(E_REF_NAME.N_bot_a_n.ToString());
this.dictRefObj[E_REF_NAME.N_bot_b_d] = base.objBody.transform.FindLoop(E_REF_NAME.N_bot_b_d.ToString());
this.dictRefObj[E_REF_NAME.N_bot_b_n] = base.objBody.transform.FindLoop(E_REF_NAME.N_bot_b_n.ToString());
this.dictRefObj[E_REF_NAME.N_sode] = base.objBody.transform.FindLoop(E_REF_NAME.N_sode.ToString());
this.dictRefObj[E_REF_NAME.N_sode01] = base.objBody.transform.FindLoop(E_REF_NAME.N_sode01.ToString());
this.dictRefObj[E_REF_NAME.N_sode02] = base.objBody.transform.FindLoop(E_REF_NAME.N_sode02.ToString());
this.dictRefObj[E_REF_NAME.N_sode03] = base.objBody.transform.FindLoop(E_REF_NAME.N_sode03.ToString());
this.dictRefObj[E_REF_NAME.N_bra_a] = base.objBody.transform.FindLoop(E_REF_NAME.N_bra_a.ToString());
this.dictRefObj[E_REF_NAME.cf_O_bra_a_d] = base.objBody.transform.FindLoop(E_REF_NAME.cf_O_bra_a_d.ToString());
this.dictRefObj[E_REF_NAME.cf_O_bra_a_n] = base.objBody.transform.FindLoop(E_REF_NAME.cf_O_bra_a_n.ToString());
this.dictRefObj[E_REF_NAME.N_bra_b] = base.objBody.transform.FindLoop(E_REF_NAME.N_bra_b.ToString());
this.dictRefObj[E_REF_NAME.cf_O_bra_b_d] = base.objBody.transform.FindLoop(E_REF_NAME.cf_O_bra_b_d.ToString());
this.dictRefObj[E_REF_NAME.cf_O_bra_b_n] = base.objBody.transform.FindLoop(E_REF_NAME.cf_O_bra_b_n.ToString());
this.dictRefObj[E_REF_NAME.N_bra_c] = base.objBody.transform.FindLoop(E_REF_NAME.N_bra_c.ToString());
this.dictRefObj[E_REF_NAME.cf_O_bra_c_d] = base.objBody.transform.FindLoop(E_REF_NAME.cf_O_bra_c_d.ToString());
this.dictRefObj[E_REF_NAME.cf_O_bra_c_n] = base.objBody.transform.FindLoop(E_REF_NAME.cf_O_bra_c_n.ToString());
this.dictRefObj[E_REF_NAME.N_shorts] = base.objBody.transform.FindLoop(E_REF_NAME.N_shorts.ToString());
this.dictRefObj[E_REF_NAME.cf_O_shorts_d] = base.objBody.transform.FindLoop(E_REF_NAME.cf_O_shorts_d.ToString());
this.dictRefObj[E_REF_NAME.cf_O_shorts_n] = base.objBody.transform.FindLoop(E_REF_NAME.cf_O_shorts_n.ToString());
this.dictRefObj[E_REF_NAME.N_option1] = base.objBody.transform.FindLoop(E_REF_NAME.N_option1.ToString());
this.dictRefObj[E_REF_NAME.N_option2] = base.objBody.transform.FindLoop(E_REF_NAME.N_option2.ToString());
this.dictRefObj[E_REF_NAME.cf_O_tang] = base.objBody.transform.FindLoop(E_REF_NAME.cf_O_tang.ToString());
}
if ((flags & 4) != 0)
{
this.dictRefObj[E_REF_NAME.cf_O_hohoaka] = base.objHead.transform.FindLoop(E_REF_NAME.cf_O_hohoaka.ToString());
this.dictRefObj[E_REF_NAME.cf_O_lip] = base.objHead.transform.FindLoop(E_REF_NAME.cf_O_lip.ToString());
this.dictRefObj[E_REF_NAME.cf_O_hitomi_L] = base.objHead.transform.FindLoop(E_REF_NAME.cf_O_hitomi_L.ToString());
this.dictRefObj[E_REF_NAME.cf_O_hitomi_R] = base.objHead.transform.FindLoop(E_REF_NAME.cf_O_hitomi_R.ToString());
this.dictRefObj[E_REF_NAME.cf_O_sitamof] = base.objHead.transform.FindLoop(E_REF_NAME.cf_O_sitamof.ToString());
this.dictRefObj[E_REF_NAME.NP_cf_acs_megane] = base.objHead.transform.FindLoop(E_REF_NAME.NP_cf_acs_megane.ToString());
this.dictRefObj[E_REF_NAME.cf_J_mouth] = base.objHead.transform.FindLoop(E_REF_NAME.cf_J_mouth.ToString());
}
if ((flags & 8) != 0)
{
this.dictRefObj[E_REF_NAME.N_cf_panst] = this.objPanst.transform.FindLoop(E_REF_NAME.N_cf_panst.ToString());
this.dictRefObj[E_REF_NAME.N_panst_d] = this.objPanst.transform.FindLoop(E_REF_NAME.N_panst_d.ToString());
this.dictRefObj[E_REF_NAME.N_panst_n] = this.objPanst.transform.FindLoop(E_REF_NAME.N_panst_n.ToString());
}
if ((flags & 0x10) != 0)
{
this.dictRefObj[E_REF_NAME.N_cf_socks] = this.objSocks.transform.FindLoop(E_REF_NAME.N_cf_socks.ToString());
}
if ((flags & 0x20) != 0)
{
this.dictRefObj[E_REF_NAME.N_cf_shoes] = this.objShoes.transform.FindLoop(E_REF_NAME.N_cf_shoes.ToString());
}
if ((flags & 0x40) != 0)
{
this.dictRefObj[E_REF_NAME.N_cf_acs_cap] = this.objAcs[0].transform.FindLoop(E_REF_NAME.N_cf_acs_cap.ToString());
}
if ((flags & 0x80) != 0)
{
this.dictRefObj[E_REF_NAME.N_cf_acs_megane] = this.objAcs[1].transform.FindLoop(E_REF_NAME.N_cf_acs_megane.ToString());
}
if ((flags & 0x100) != 0)
{
this.dictRefObj[E_REF_NAME.N_cf_acs_earrings] = this.objAcs[2].transform.FindLoop(E_REF_NAME.N_cf_acs_earrings.ToString());
}
if ((flags & 0x200) != 0)
{
this.dictRefObj[E_REF_NAME.N_cf_acs_head] = this.objAcs[3].transform.FindLoop(E_REF_NAME.N_cf_acs_head.ToString());
}
if ((flags & 0x400) != 0)
{
this.dictRefObj[E_REF_NAME.N_cf_acs_back] = this.objAcs[4].transform.FindLoop(E_REF_NAME.N_cf_acs_back.ToString());
}
if ((flags & 0x800) != 0)
{
this.dictRefObj[E_REF_NAME.N_cf_acs_waist] = this.objAcs[5].transform.FindLoop(E_REF_NAME.N_cf_acs_waist.ToString());
}
if ((flags & 0x1000) != 0)
{
this.dictRefObj[E_REF_NAME.N_cf_acs_wrist_l] = this.objAcs[6].transform.FindLoop(E_REF_NAME.N_cf_acs_wrist_l.ToString());
}
if ((flags & 0x2000) != 0)
{
this.dictRefObj[E_REF_NAME.N_cf_acs_wrist_r] = this.objAcs[7].transform.FindLoop(E_REF_NAME.N_cf_acs_wrist_r.ToString());
}
if ((flags & 0x4000) != 0)
{
this.dictRefObj[E_REF_NAME.N_cf_acs_neck] = this.objAcs[8].transform.FindLoop(E_REF_NAME.N_cf_acs_neck.ToString());
}
}
public override void LateUpdate()
{
this.CShadowProc();
bool flag = false;
if (0 != this.cosTopState)
{
if (0 != this.cosBuraState)
{
flag = true;
}
else if (null == this.GetRefObject(E_REF_NAME.cf_O_bra_b_d))
{
flag = true;
}
}
if (this.BodySubInfo.NipAlwaysStand)
{
flag = true;
}
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) };
for (int i = 0; i < 2; i++)
{
if (null != objArray[i])
{
objArray[i].transform.SetLocalPositionZ(!flag ? 0f : 0.003f);
objArray[i].transform.SetLocalScaleX(!flag ? 1f : 1.5f);
}
}
}
public bool LoadCharaData(BinaryReader reader, byte loadType = 0)
{
if (loadType == 0)
{
this.saveTexBytes = PngAssist.LoadPngData(reader);
}
else
{
PngAssist.SkipPngData(reader);
}
this.LoadVersion = reader.ReadInt32();
if (this.LoadVersion > 0x6b)
{
return false;
}
if ((0x66 <= this.LoadVersion) && (string.Compare(reader.ReadString(), "【HaremMate Chara SaveData】") != 0))
{
return false;
}
if (0x67 <= this.LoadVersion)
{
this.prevInfo.LoadPreviewInfo(reader, this.LoadVersion);
}
if (loadType != 1)
{
this.charCustom.LoadCustomInfo(reader, this.LoadVersion);
if (loadType == 2)
{
return true;
}
this.cosCustom.LoadCosFavoriteCore(reader);
this.charaNo = this.prevInfo.CharaNo;
if (0x69 <= this.LoadVersion)
{
this.status.Load(reader, this.LoadVersion);
}
if (0x6a <= this.LoadVersion)
{
this.lockParam = reader.ReadBoolean();
}
}
return true;
}
public bool LoadCharaData(Stream st, byte loadType = 0)
{
using (BinaryReader reader = new BinaryReader(st))
{
return this.LoadCharaData(reader, loadType);
}
}
public bool LoadCharaData(string filename, byte loadType = 0)
{
string path = UserData.Path + "chara/" + filename;
if (!File.Exists(path))
{
return false;
}
this.saveFileName = filename;
using (FileStream stream = new FileStream(path, FileMode.Open, FileAccess.Read))
{
return this.LoadCharaData(stream, loadType);
}
}
public bool LoadCharaData(string filename, string assetPath, string resourcesDir, byte loadType = 0)
{
string path = Singleton<Manager.Loader>.Instance.AssetPath + assetPath;
if (string.Compare(".unity3d", Path.GetExtension(path)) != 0)
{
path = Path.ChangeExtension(path, ".unity3d");
}
Singleton<Manager.Loader>.Instance.CreateFromFile(path);
TextAsset asset = Singleton<Manager.Loader>.Instance.AssetBundleRefs[path].assetBundle.Load(filename, typeof(TextAsset)) as TextAsset;
Singleton<Manager.Loader>.Instance.Unload(path, false);
if (null == asset)
{
return false;
}
using (MemoryStream stream = new MemoryStream())
{
stream.Write(asset.bytes, 0, asset.bytes.Length);
stream.Seek(0L, SeekOrigin.Begin);
return this.LoadCharaData(stream, loadType);
}
}
public bool OverwriteCharaData(BinaryWriter writer)
{
if (this.saveTexBytes != null)
{
writer.Write(this.saveTexBytes);
}
return this.WriteCharaDataWithoutPNG(writer);
}
public bool OverwriteCharaData(Stream st)
{
using (BinaryWriter writer = new BinaryWriter(st))
{
return this.OverwriteCharaData(writer);
}
}
public bool OverwriteCharaData(string filename = "")
{
string str = (string.Compare(filename, string.Empty) != 0) ? filename : this.saveFileName;
using (FileStream stream = new FileStream(UserData.Create("chara") + str, FileMode.Create, FileAccess.Write))
{
return this.OverwriteCharaData(stream);
}
}
public bool OverwriteCharaPNG(byte[] pngData, string filename = "")
{
string str = (string.Compare(filename, string.Empty) != 0) ? filename : this.saveFileName;
using (FileStream stream = new FileStream(UserData.Create("chara") + str, FileMode.Create, FileAccess.Write))
{
return this.OverwriteCharaPNG(stream, pngData);
}
}
public bool OverwriteCharaPNG(BinaryWriter writer, byte[] pngData)
{
if (pngData != null)
{
writer.Write(pngData);
}
return this.WriteCharaDataWithoutPNG(writer);
}
public bool OverwriteCharaPNG(Stream st, byte[] pngData)
{
using (BinaryWriter writer = new BinaryWriter(st))
{
return this.OverwriteCharaPNG(writer, pngData);
}
}
public void ReInitHStatus()
{
this.status.MemberInit();
}
public bool SaveCharaDataNew(string filename, bool debug = false)
{
using (FileStream stream = new FileStream(UserData.Create("chara") + filename, FileMode.Create, FileAccess.Write))
{
using (BinaryWriter writer = new BinaryWriter(stream))
{
PngAssist.SavePng(writer, !debug ? ((byte) 1) : ((byte) 0));
this.WriteCharaDataWithoutPNG(writer);
}
}
return true;
}
public void SetAcsNo(E_ACS_KIND kind, int no)
{
this.acsNo[(int) kind] = new int?(no);
}
public void SetAudioSource(AudioSource _asMain, AudioSource _asSub)
{
this.asMain = _asMain;
this.asSub = _asSub;
}
public void SetBlinkFlag(bool blink)
{
if (this.blinkCtrl != null)
{
this.blinkCtrl.SetFixedFlags(!blink ? ((byte) 1) : ((byte) 0));
}
}
public void SetCharaCreateFlag(bool flags)
{
this.charaCreateFlag = flags;
}
public void SetCharaNo(int no)
{
this.charaNo = no;
}
public void SetCosBottomType(byte type)
{
this.cosBottomType = new byte?(type);
}
public void SetCosSodeType(byte type)
{
this.cosSodeType = new byte?(type);
}
public void SetCustomUpdateFlags(bool flags)
{
this.customUpdate = flags;
}
private void SetDBHairCollision(GameObject objHair)
{
if (null != objHair)
{
List<GameObject> list = new List<GameObject>();
objHair.transform.FindLoopTag(list, "DBHair");
foreach (GameObject obj2 in list)
{
foreach (DynamicBone bone in obj2.GetComponents<DynamicBone>())
{
foreach (GameObject obj3 in this.listTagColHair)
{
DynamicBoneCollider component = obj3.GetComponent<DynamicBoneCollider>();
if (null != component)
{
bone.m_Colliders.Add(component);
}
}
}
}
}
}
public void SetEyesHi(bool show)
{
this.eyesHi = show;
foreach (GameObject obj2 in this.listTagEyeHi)
{
if (null != obj2.renderer)
{
Color color = obj2.renderer.material.color;
color.a = !show ? 0f : 1f;
obj2.renderer.material.color = color;
}
}
}
public void SetFixedEyebrowOpen(float rate)
{
if (this.EyebrowCtrl != null)
{
this.EyebrowCtrl.FixedRate = Mathf.Clamp(rate, 0f, 1f);
}
}
public void SetFixedEyesOpen(float rate)
{
if (this.EyesCtrl != null)
{
float num = Mathf.Lerp(0f, 0.9f, Mathf.Clamp(rate, 0f, 1f));
this.EyesCtrl.FixedRate = num;
}
}
public void SetFixedMouthOpen(float rate, bool nolimit = false)
{
if (this.MouthCtrl != null)
{
if (!nolimit)
{
this.MouthCtrl.FixedRate = Mathf.Clamp(rate, 0f, 1f);
}
else
{
this.MouthCtrl.FixedRate = rate;
}
}
}
public void SetMouthWidth(float rate)
{
GameObject refObject = this.GetRefObject(E_REF_NAME.cf_J_mouth);
if (refObject != null)
{
float x = Mathf.Lerp(0.9f, 1.1f, rate);
refObject.transform.SetLocalScaleX(x);
}
}
public void SetNeckFixAngle(Quaternion fixQ)
{
if (null != this.neckLookCtrl)
{
this.neckLookCtrl.neckLookScript.fixAngle = fixQ;
}
}
public void SetPanstNo(int no)
{
this.panstNo = new int?(no);
}
public void SetShoesNo(int no)
{
this.shoesNo = new int?(no);
}
public bool SetSiru(byte targ, int lv)
{
string assetfilePath = "chara/cha_etc.unity3d";
if (targ == 0)
{
Material[] materialArray = new Material[2];
if (lv != 0)
{
for (int i = 0; i < 2; i++)
{
string resourcePath = "Prefabs/chara/etc/siru_f" + lv.ToString("00") + "_" + i.ToString();
materialArray[i] = Helper.Loader.Load(assetfilePath, resourcePath, typeof(Material)) as Material;
}
}
foreach (GameObject obj2 in this.listTagSkinF)
{
Renderer component = obj2.GetComponent<Renderer>();
if (null != component)
{
if (lv == 0)
{
component.materials = new Material[] { component.material };
}
else
{
component.materials = new Material[] { component.material, materialArray[0], materialArray[1] };
}
}
}
}
else if (targ == 1)
{
Material[] materialArray4 = new Material[2];
if (lv != 0)
{
for (int j = 0; j < 2; j++)
{
string str3 = "Prefabs/chara/etc/siru_b" + lv.ToString("00") + "_" + j.ToString();
materialArray4[j] = Helper.Loader.Load(assetfilePath, str3, typeof(Material)) as Material;
}
}
foreach (GameObject obj3 in this.listTagSkinB)
{
Renderer renderer2 = obj3.GetComponent<Renderer>();
if (null != renderer2)
{
if (lv == 0)
{
renderer2.materials = new Material[] { renderer2.material };
}
else
{
renderer2.materials = new Material[] { renderer2.material, materialArray4[0], materialArray4[1] };
}
}
}
}
return true;
}
public void SetSocksNo(int no)
{
this.socksNo = new int?(no);
}
public override void SetVisibleSub(bool Visible)
{
if (this.objPanst != null)
{
this.objPanst.SetActive(Visible);
}
if (this.objSocks != null)
{
this.objSocks.SetActive(Visible);
}
if (this.objShoes != null)
{
this.objShoes.SetActive(Visible);
}
foreach (GameObject obj2 in this.objAcs)
{
obj2.SetActive(Visible);
}
if (this.objEyeline != null)
{
this.objEyeline.SetActive(Visible);
}
if (this.objHairF != null)
{
this.objHairF.SetActive(Visible);
}
if (this.objHairB != null)
{
this.objHairB.SetActive(Visible);
}
if (this.objHairS != null)
{
this.objHairS.SetActive(Visible);
}
if (this.objHairO != null)
{
this.objHairO.SetActive(Visible);
}
this.customUpdate = true;
}
public override void Update()
{
if (this.customUpdate)
{
this.charCustom.UpdateShapeFace();
this.charCustom.UpdateShapeBody();
if (null != this.objEyeline)
{
Animator component = this.objEyeline.GetComponent<Animator>();
int num = 8;
if (num <= component.layerCount)
{
for (int i = 0; i < num; i++)
{
component.Play(component.GetCurrentAnimatorStateInfo(i + 1).nameHash, i + 1, this.charCustom.nowCCI.shapeFace[i]);
}
}
}
this.customUpdate = false;
}
this.UpdateSiru();
this.blinkCtrl.CalcBlink();
this.UpdateBlendShapeVoice();
}
private void UpdateBlendShapeVoice()
{
float audioWaveValue = 0f;
if ((this.asMain != null) && this.asMain.isPlaying)
{
audioWaveValue = this.fbsaaVoice.GetAudioWaveValue(this.asMain);
}
if (((audioWaveValue == 0f) && (this.asSub != null)) && this.asSub.isPlaying)
{
audioWaveValue = this.fbsaaVoice.GetAudioWaveValue(this.asSub);
}
if (this.fbsCtrlHead != null)
{
this.fbsCtrlHead.SetVoiceVaule(audioWaveValue);
}
}
public void UpdateCustomInfo()
{
int? nipTexType = this.charCustom.nowCCI.nipTexType;
int? nipTexColor = this.charCustom.nowCCI.nipTexColor;
this.charCustom.ChangeTexNip(!nipTexType.HasValue ? 0 : nipTexType.Value, !nipTexColor.HasValue ? 0 : nipTexColor.Value, true);
this.charCustom.ChangeNipShader(this.charCustom.nowCCI.nipAlpha);
int? skinTexColor = this.charCustom.nowCCI.skinTexColor;
this.charCustom.ChangeTexSkin(!skinTexColor.HasValue ? 0 : skinTexColor.Value, true);
int? uhairTexType = this.charCustom.nowCCI.uhairTexType;
this.charCustom.ChangeTexUHair(!uhairTexType.HasValue ? 0 : uhairTexType.Value, true);
this.charCustom.ChangeUHairShader(this.charCustom.nowCCI.uhairColor, this.charCustom.nowCCI.uhairAlpha);
int? nullable5 = this.charCustom.nowCCI.skinTexColor;
this.charCustom.ChangeTexSkin(!nullable5.HasValue ? 0 : nullable5.Value, true);
int? eyeblowTexType = this.charCustom.nowCCI.eyeblowTexType;
this.charCustom.ChangeTexEyeBlow(!eyeblowTexType.HasValue ? 0 : eyeblowTexType.Value, true);
this.charCustom.ChangeEyeblowShader(this.charCustom.nowCCI.eyeblowColor);
int? eyeTexType = this.charCustom.nowCCI.eyeTexType;
this.charCustom.ChangeTexEye(!eyeTexType.HasValue ? 0 : eyeTexType.Value, true);
for (int i = 0; i < 2; i++)
{
this.charCustom.ChangeEyeShader((byte) i, this.charCustom.nowCCI.eyeColor[i]);
}
int? eyeHiTexType = this.charCustom.nowCCI.eyeHiTexType;
this.charCustom.ChangeTexEyeHi(!eyeHiTexType.HasValue ? 0 : eyeHiTexType.Value, true);
this.charCustom.ChangeLipShader(this.charCustom.nowCCI.lipColor, this.charCustom.nowCCI.lipAlpha);
this.SetCustomUpdateFlags(true);
this.ChangeHeadFromSetting(true);
this.ChangeHairFromSetting(true);
}
public void UpdateSiru()
{
for (int i = 0; i < 2; i++)
{
if (this.siruLv[i] != this.updateSiruLv[i])
{
this.SetSiru((byte) i, this.updateSiruLv[i]);
this.siruLv[i] = this.updateSiruLv[i];
}
}
}
public void UpdateSiruFlag(byte targ = 2, int lv = -1)
{
if (lv == -1)
{
int num;
if ((targ == 0) || (targ == 2))
{
this.updateSiruLv[0] = num = this.updateSiruLv[0] + 1;
this.updateSiruLv[0] = Mathf.Min(num, 3);
}
if ((targ == 1) || (targ == 2))
{
this.updateSiruLv[1] = num = this.updateSiruLv[1] + 1;
this.updateSiruLv[1] = Mathf.Min(num, 3);
}
}
else
{
if ((targ == 0) || (targ == 2))
{
this.updateSiruLv[0] = lv;
}
if ((targ == 1) || (targ == 2))
{
this.updateSiruLv[1] = lv;
}
}
}
public bool WriteCharaDataWithoutPNG(BinaryWriter writer)
{
writer.Write(0x6b);
writer.Write("【HaremMate Chara SaveData】");
writer.Write(this.charCustom.nowCCI.lastName);
writer.Write(this.charCustom.nowCCI.firstName);
int? personalType = this.charCustom.nowCCI.personalType;
this.charCustom.nowCCI.personalType = new int?(!personalType.HasValue ? 0 : personalType.Value);
writer.Write(this.charCustom.nowCCI.personalType.Value);
byte num = 0;
float num2 = this.charCustom.nowCCI.shapeBody[0];
if (num2 < 0.33f)
{
num = 0;
}
else if (num2 < 0.66f)
{
num = 1;
}
else
{
num = 2;
}
writer.Write(num);
writer.Write(this.charCustom.nowCCI.hairBNo.Value);
if (this.charaCreateFlag)
{
writer.Write(Singleton<Game>.Instance.productionName);
}
else
{
writer.Write(this.prevInfo.PCName);
}
writer.Write(!this.status._actCnt.virgin ? ((byte) 0) : ((byte) 1));
writer.Write(this.status._actCnt.sexCount);
writer.Write(this.charaNo);
writer.Write(this.lockParam);
this.charCustom.SaveCustomInfo(writer);
this.cosCustom.SaveCosFavoriteCore(writer);
this.status.Save(writer);
writer.Write(this.lockParam);
return true;
}
public class BodySubInfoClass
{
public bool[] Bottom = new bool[2];
public bool IsBottom;
public bool IsBura;
public bool IsDBSkirt = true;
public bool IsDBZubon = true;
public bool IsOption;
public bool IsPants;
public bool IsTBSet;
public bool NipAlwaysStand;
public bool[] Sode = new bool[3];
public bool UsePanst = true;
public void SetFlags(string type)
{
char[] separator = new char[] { '/' };
string[] strArray = type.Split(separator);
if (strArray.Length != 10)
{
Debug.LogError("体サブ情報量が足りません");
}
else
{
this.IsTBSet = int.Parse(strArray[0]) != 0;
this.Sode[0] = (int.Parse(strArray[1]) & 1) != 0;
this.Sode[1] = (int.Parse(strArray[1]) & 2) != 0;
this.Sode[2] = (int.Parse(strArray[1]) & 4) != 0;
this.Bottom[0] = (int.Parse(strArray[2]) & 1) != 0;
this.Bottom[1] = (int.Parse(strArray[2]) & 2) != 0;
this.IsBottom = int.Parse(strArray[3]) != 0;
this.IsBura = int.Parse(strArray[4]) != 0;
this.IsPants = int.Parse(strArray[5]) != 0;
this.UsePanst = int.Parse(strArray[6]) != 0;
this.IsOption = int.Parse(strArray[7]) != 0;
int num = int.Parse(strArray[8]);
if (num == 0)
{
this.IsDBSkirt = false;
this.IsDBZubon = false;
}
else
{
this.IsDBSkirt = (num & 1) != 0;
this.IsDBZubon = (num & 2) != 0;
}
this.NipAlwaysStand = int.Parse(strArray[9]) != 0;
}
}
}
public enum E_ACS_KIND
{
ACS_CAP,
ACS_MEGANE,
ACS_EARRINGS,
ACS_HEAD,
ACS_BACK,
ACS_WAIST,
ACS_WRIST_L,
ACS_WRIST_R,
ACS_NECK,
ACS_KIND_NUM
}
public enum E_REF_NAME
{
cf_Joint_00,
cf_J_sk_top_dam,
cf_J_ArmUp00_L,
cf_J_ArmUp00_R,
cf_J_LegUp02_L,
cf_J_LegUp02_R,
cf_J_Hips,
cf_J_Head_s,
cf_O_hohoaka,
cf_O_lip,
cf_O_hitomi_L,
cf_O_hitomi_R,
cf_O_tang,
cf_O_sitamof,
cf_J_Mune_Nip02_s_L,
cf_J_Mune_Nip02_s_R,
cf_J_Mune00,
cf_J_Neck,
NP_cf_acs_back,
NP_cf_acs_waist,
NP_cf_acs_wrist_l,
NP_cf_acs_wrist_r,
NP_cf_acs_neck,
NP_cf_acs_megane,
N_bottoms_a,
N_bottoms_b,
N_tops_a,
N_tops_b,
N_tops_c,
N_bot_a_d,
N_bot_a_n,
N_bot_b_d,
N_bot_b_n,
N_bra_a,
N_sode,
N_sode01,
N_sode02,
N_sode03,
cf_O_bra_a_d,
cf_O_bra_a_n,
N_bra_b,
cf_O_bra_b_d,
cf_O_bra_b_n,
N_bra_c,
cf_O_bra_c_d,
cf_O_bra_c_n,
N_shorts,
cf_O_shorts_d,
cf_O_shorts_n,
N_option1,
N_option2,
N_cf_panst,
N_panst_d,
N_panst_n,
N_cf_socks,
N_cf_shoes,
N_cf_acs_cap,
N_cf_acs_megane,
N_cf_acs_earrings,
N_cf_acs_head,
N_cf_acs_back,
N_cf_acs_waist,
N_cf_acs_wrist_l,
N_cf_acs_wrist_r,
N_cf_acs_neck,
cf_J_mouth
}
public class PreviewInfo
{
public byte BustType;
public int CharaNo = -1;
public string FirstName = string.Empty;
public int HairBNo;
public int HCount;
public byte IsVirgin = 1;
public string LastName = string.Empty;
public bool paramLock;
public string PCName = string.Empty;
public int PersonalType;
public void LoadPreviewInfo(BinaryReader reader, int loadVersion)
{
this.LastName = reader.ReadString();
this.FirstName = reader.ReadString();
this.PersonalType = reader.ReadInt32();
this.BustType = reader.ReadByte();
this.HairBNo = reader.ReadInt32();
this.PCName = reader.ReadString();
this.IsVirgin = reader.ReadByte();
this.HCount = reader.ReadInt32();
if (0x68 <= loadVersion)
{
this.CharaNo = reader.ReadInt32();
}
if (0x6b <= loadVersion)
{
this.paramLock = reader.ReadBoolean();
}
}
}
}