public static string SaveInstance(UMADnaHumanoid instance)
        {
#if !StripLitJson
            return(LitJson.JsonMapper.ToJson(UMADnaHumanoid_Byte.FromDna(instance)));
#else
            return(null);
#endif
        }
        public static UMADnaHumanoid_Byte FromDna(UMADnaHumanoid dna)
        {
            var res = new UMADnaHumanoid_Byte();

            res.height             = (System.Byte)(dna.height * 255f + 0.5f);
            res.headSize           = (System.Byte)(dna.headSize * 255f + 0.5f);
            res.headWidth          = (System.Byte)(dna.headWidth * 255f + 0.5f);
            res.neckThickness      = (System.Byte)(dna.neckThickness * 255f + 0.5f);
            res.armLength          = (System.Byte)(dna.armLength * 255f + 0.5f);
            res.forearmLength      = (System.Byte)(dna.forearmLength * 255f + 0.5f);
            res.armWidth           = (System.Byte)(dna.armWidth * 255f + 0.5f);
            res.forearmWidth       = (System.Byte)(dna.forearmWidth * 255f + 0.5f);
            res.handsSize          = (System.Byte)(dna.handsSize * 255f + 0.5f);
            res.feetSize           = (System.Byte)(dna.feetSize * 255f + 0.5f);
            res.legSeparation      = (System.Byte)(dna.legSeparation * 255f + 0.5f);
            res.upperMuscle        = (System.Byte)(dna.upperMuscle * 255f + 0.5f);
            res.lowerMuscle        = (System.Byte)(dna.lowerMuscle * 255f + 0.5f);
            res.upperWeight        = (System.Byte)(dna.upperWeight * 255f + 0.5f);
            res.lowerWeight        = (System.Byte)(dna.lowerWeight * 255f + 0.5f);
            res.legsSize           = (System.Byte)(dna.legsSize * 255f + 0.5f);
            res.belly              = (System.Byte)(dna.belly * 255f + 0.5f);
            res.waist              = (System.Byte)(dna.waist * 255f + 0.5f);
            res.gluteusSize        = (System.Byte)(dna.gluteusSize * 255f + 0.5f);
            res.earsSize           = (System.Byte)(dna.earsSize * 255f + 0.5f);
            res.earsPosition       = (System.Byte)(dna.earsPosition * 255f + 0.5f);
            res.earsRotation       = (System.Byte)(dna.earsRotation * 255f + 0.5f);
            res.noseSize           = (System.Byte)(dna.noseSize * 255f + 0.5f);
            res.noseCurve          = (System.Byte)(dna.noseCurve * 255f + 0.5f);
            res.noseWidth          = (System.Byte)(dna.noseWidth * 255f + 0.5f);
            res.noseInclination    = (System.Byte)(dna.noseInclination * 255f + 0.5f);
            res.nosePosition       = (System.Byte)(dna.nosePosition * 255f + 0.5f);
            res.nosePronounced     = (System.Byte)(dna.nosePronounced * 255f + 0.5f);
            res.noseFlatten        = (System.Byte)(dna.noseFlatten * 255f + 0.5f);
            res.chinSize           = (System.Byte)(dna.chinSize * 255f + 0.5f);
            res.chinPronounced     = (System.Byte)(dna.chinPronounced * 255f + 0.5f);
            res.chinPosition       = (System.Byte)(dna.chinPosition * 255f + 0.5f);
            res.mandibleSize       = (System.Byte)(dna.mandibleSize * 255f + 0.5f);
            res.jawsSize           = (System.Byte)(dna.jawsSize * 255f + 0.5f);
            res.jawsPosition       = (System.Byte)(dna.jawsPosition * 255f + 0.5f);
            res.cheekSize          = (System.Byte)(dna.cheekSize * 255f + 0.5f);
            res.cheekPosition      = (System.Byte)(dna.cheekPosition * 255f + 0.5f);
            res.lowCheekPronounced = (System.Byte)(dna.lowCheekPronounced * 255f + 0.5f);
            res.lowCheekPosition   = (System.Byte)(dna.lowCheekPosition * 255f + 0.5f);
            res.foreheadSize       = (System.Byte)(dna.foreheadSize * 255f + 0.5f);
            res.foreheadPosition   = (System.Byte)(dna.foreheadPosition * 255f + 0.5f);
            res.lipsSize           = (System.Byte)(dna.lipsSize * 255f + 0.5f);
            res.mouthSize          = (System.Byte)(dna.mouthSize * 255f + 0.5f);
            res.eyeRotation        = (System.Byte)(dna.eyeRotation * 255f + 0.5f);
            res.eyeSize            = (System.Byte)(dna.eyeSize * 255f + 0.5f);
            res.breastSize         = (System.Byte)(dna.breastSize * 255f + 0.5f);

            return(res);
        }
		public static UMADnaHumanoid_Byte FromDna(UMADnaHumanoid dna)
		{
			var res = new UMADnaHumanoid_Byte();
			res.height = (System.Byte)(dna.height * 255f+0.5f);
		res.headSize = (System.Byte)(dna.headSize * 255f+0.5f);
		res.headWidth = (System.Byte)(dna.headWidth * 255f+0.5f);
		res.neckThickness = (System.Byte)(dna.neckThickness * 255f+0.5f);
		res.armLength = (System.Byte)(dna.armLength * 255f+0.5f);
		res.forearmLength = (System.Byte)(dna.forearmLength * 255f+0.5f);
		res.armWidth = (System.Byte)(dna.armWidth * 255f+0.5f);
		res.forearmWidth = (System.Byte)(dna.forearmWidth * 255f+0.5f);
		res.handsSize = (System.Byte)(dna.handsSize * 255f+0.5f);
		res.feetSize = (System.Byte)(dna.feetSize * 255f+0.5f);
		res.legSeparation = (System.Byte)(dna.legSeparation * 255f+0.5f);
		res.upperMuscle = (System.Byte)(dna.upperMuscle * 255f+0.5f);
		res.lowerMuscle = (System.Byte)(dna.lowerMuscle * 255f+0.5f);
		res.upperWeight = (System.Byte)(dna.upperWeight * 255f+0.5f);
		res.lowerWeight = (System.Byte)(dna.lowerWeight * 255f+0.5f);
		res.legsSize = (System.Byte)(dna.legsSize * 255f+0.5f);
		res.belly = (System.Byte)(dna.belly * 255f+0.5f);
		res.waist = (System.Byte)(dna.waist * 255f+0.5f);
		res.gluteusSize = (System.Byte)(dna.gluteusSize * 255f+0.5f);
		res.earsSize = (System.Byte)(dna.earsSize * 255f+0.5f);
		res.earsPosition = (System.Byte)(dna.earsPosition * 255f+0.5f);
		res.earsRotation = (System.Byte)(dna.earsRotation * 255f+0.5f);
		res.noseSize = (System.Byte)(dna.noseSize * 255f+0.5f);
		res.noseCurve = (System.Byte)(dna.noseCurve * 255f+0.5f);
		res.noseWidth = (System.Byte)(dna.noseWidth * 255f+0.5f);
		res.noseInclination = (System.Byte)(dna.noseInclination * 255f+0.5f);
		res.nosePosition = (System.Byte)(dna.nosePosition * 255f+0.5f);
		res.nosePronounced = (System.Byte)(dna.nosePronounced * 255f+0.5f);
		res.noseFlatten = (System.Byte)(dna.noseFlatten * 255f+0.5f);
		res.chinSize = (System.Byte)(dna.chinSize * 255f+0.5f);
		res.chinPronounced = (System.Byte)(dna.chinPronounced * 255f+0.5f);
		res.chinPosition = (System.Byte)(dna.chinPosition * 255f+0.5f);
		res.mandibleSize = (System.Byte)(dna.mandibleSize * 255f+0.5f);
		res.jawsSize = (System.Byte)(dna.jawsSize * 255f+0.5f);
		res.jawsPosition = (System.Byte)(dna.jawsPosition * 255f+0.5f);
		res.cheekSize = (System.Byte)(dna.cheekSize * 255f+0.5f);
		res.cheekPosition = (System.Byte)(dna.cheekPosition * 255f+0.5f);
		res.lowCheekPronounced = (System.Byte)(dna.lowCheekPronounced * 255f+0.5f);
		res.lowCheekPosition = (System.Byte)(dna.lowCheekPosition * 255f+0.5f);
		res.foreheadSize = (System.Byte)(dna.foreheadSize * 255f+0.5f);
		res.foreheadPosition = (System.Byte)(dna.foreheadPosition * 255f+0.5f);
		res.lipsSize = (System.Byte)(dna.lipsSize * 255f+0.5f);
		res.mouthSize = (System.Byte)(dna.mouthSize * 255f+0.5f);
		res.eyeRotation = (System.Byte)(dna.eyeRotation * 255f+0.5f);
		res.eyeSize = (System.Byte)(dna.eyeSize * 255f+0.5f);
		res.breastSize = (System.Byte)(dna.breastSize * 255f+0.5f);

			return res;
		}
 public static string SaveInstance(UMADnaHumanoid instance)
 {
     return(UnityEngine.JsonUtility.ToJson(UMADnaHumanoid_Byte.FromDna(instance)));
 }
Beispiel #5
0
 public static string SaveInstance(UMADnaHumanoid instance)
 {
     return(LitJson.JsonMapper.ToJson(UMADnaHumanoid_Byte.FromDna(instance)));
 }