public void CopyParams(ParamHipCustom target) { target.gravity = gravity; foreach (XMLParamSet set in paramSets) { set.CopyParameterTo(target.paramBones[set.PartName]); } }
public void CopyParamsFrom(ParamHipCustom src) { gravity = src.gravity; foreach (string bone in Bones) { paramBones[bone].CopyParameterFrom(src.paramBones[bone]); } }
private void LoadParamFrom(ParamHipCustom source) { gravity = source.gravity; foreach (XMLParamSet set in paramSets) { set.CopyParameterFrom(source.paramBones[set.PartName]); } }
public static void SaveXMLHip(ParamHipCustom hip, string path) { XMLParamHip xml = new XMLParamHip(hip); using (FileStream fs = new FileStream(path, FileMode.Create, FileAccess.Write)) using (StreamWriter sw = new StreamWriter(fs)) { xml.Serialize(sw); } }
public XMLParamHip(ParamHipCustom param) { paramSets = new List <XMLParamSet>(); foreach (string partName in partNames) { XMLParamSet set = new XMLParamSet(); set.PartName = partName; paramSets.Add(set); } LoadParamFrom(param); }
public ParamHipCustom Clone() { ParamHipCustom result = new ParamHipCustom(); result.enabled = enabled; result.gravity = gravity; foreach (string bone in paramBones.Keys) { result.paramBones[bone] = paramBones[bone].Clone(); } return(result); }
public static bool LoadXMLHip(ParamHipCustom hip, string path) { XMLParamHip xml = new XMLParamHip(); using (StreamReader reader = new StreamReader(path)) { if (!xml.Deserialize(reader)) { return(false); } } xml.CopyParams(hip); return(true); }
public static bool ApplyParamHip(ParamHipCustom source, DynamicBone_Ver02 target) { List <DynamicBone_Ver02.Particle> particles = GetCharacterParticles(target); if (particles != null) { target.setGravity(0, new UnityEngine.Vector3(0, source.gravity, 0)); source.CopyTo(particles); return(true); } else { return(false); } }
public ParamChara() { paramBustNaked = new ParamBustCustom(); //Create instance of breast's paramter per coordinates,wearStates. paramBust = new Dictionary <ChaFileDefine.CoordinateType, Dictionary <ParamCharaController.ParamsKind, ParamBustCustom> >(); for (int coordinate = 0; coordinate < Coordinates.Count(); coordinate++) { Dictionary <ParamCharaController.ParamsKind, ParamBustCustom> parametersCoordinate = new Dictionary <ParamCharaController.ParamsKind, ParamBustCustom>(); for (int wearState = 0; wearState < WearStates.Count(); wearState++) { ParamBustCustom parameterBreast = new ParamBustCustom(Coordinates[coordinate], WearStates[wearState]); parametersCoordinate.Add(WearStates[wearState], parameterBreast); } paramBust.Add(Coordinates[coordinate], parametersCoordinate); } //Hip Custom paramHip = new ParamHipCustom(); }