private void LockOn() { CharFemale character = instance.female; if (character != null) { CharBody body = character.chaBody; string prefix = "cf_"; if (!cameraTarget) { cameraTarget = body.objBone.transform.FindLoop(prefix + boneList[0]); } else { for (int i = 0; i < boneList.Length; i++) { if (cameraTarget.name == prefix + boneList[i]) { string boneName = boneList.ElementAtOrDefault(i + 1) != null ? prefix + boneList[i + 1] : prefix + boneList[0]; cameraTarget = body.objBone.transform.FindLoop(boneName); break; } } } if (lastBonePos == null) { lastBonePos = camera.transBase.InverseTransformPoint(cameraTarget.transform.position); } normalCameraMoveSpeed = camera.moveSpeed; camera.moveSpeed = 0.0f; CreateInfoMsg("Locked to \"" + cameraTarget.name + "\""); } }
void CheckFemale(CharFemale female) { // Get controllers var eyeLookCtrl = eyeLookCtrlInfo.GetValue(female) as EyeLookController; var targetCtrl = female.GetBodyObj().GetComponent <EyeTargetController>(); // Make a new EyeTargetController if required if (targetCtrl == null) { targetCtrl = female.GetBodyObj().AddComponent <EyeTargetController>(); targetCtrl.rootNode = eyeLookCtrl.eyeLookScript.rootNode; } // Replace camera targets if required if (eyeLookCtrl.target.camera == Camera.main) { eyeLookCtrl.target = targetCtrl.Target; } var neckLookCtrl = neckLookCtrlInfo.GetValue(female) as NeckLookController; if (neckLookCtrl.target.camera == Camera.main) { neckLookCtrl.target = targetCtrl.Target; } }
public static void UpdateFace(this CharFemale chara) { Texture2D texture2D = null; Texture texture = null, texture2 = null; chara.femaleBody.customTexCtrlFace.SetColor(Manager.Character.Instance._Color, chara.femaleCustomInfo.skinColor.rgbaDiffuse); chara.femaleBody.customMatFace.SetFloat(Manager.Character.Instance._Metallic, chara.femaleCustomInfo.skinColor.specularIntensity); chara.femaleBody.customMatFace.SetFloat(Manager.Character.Instance._Smoothness, chara.femaleCustomInfo.skinColor.specularSharpness); chara.femaleCustom.LoatTextureInfo(CharaListInfo.TypeFemaleTexture.cf_t_face, ref chara.femaleCustomInfo.texFaceId, ref texture2D, ref texture, ref texture2); chara.femaleBody.customTexCtrlFace.SetMainTexture(texture2D); chara.femaleBody.customTexCtrlFace.SetColor(Manager.Character.Instance._Color3, chara.femaleCustomInfo.tattoo_fColor.rgbaDiffuse); chara.femaleCustom.LoatTextureInfo(CharaListInfo.TypeFemaleTexture.cf_t_tattoo_f, ref chara.femaleCustomInfo.texTattoo_fId, ref texture2D, ref texture, ref texture2); chara.femaleBody.customTexCtrlFace.SetTexture(Manager.Character.Instance._Texture3, texture2D); chara.femaleBody.customTexCtrlFace.SetColor(Manager.Character.Instance._Color4, chara.femaleCustomInfo.cheekColor.rgbaDiffuse); chara.femaleCustom.LoatTextureInfo(CharaListInfo.TypeFemaleTexture.cf_t_cheek, ref chara.femaleCustomInfo.texCheekId, ref texture2D, ref texture, ref texture2); chara.femaleBody.customTexCtrlFace.SetTexture(Manager.Character.Instance._Texture4, texture2D); chara.femaleBody.customTexCtrlFace.SetColor(Manager.Character.Instance._Color5, chara.femaleCustomInfo.eyeshadowColor.rgbaDiffuse); chara.femaleCustom.LoatTextureInfo(CharaListInfo.TypeFemaleTexture.cf_t_eyeshadow, ref chara.femaleCustomInfo.texEyeshadowId, ref texture2D, ref texture, ref texture2); chara.femaleBody.customTexCtrlFace.SetTexture(Manager.Character.Instance._Texture5, texture2D); chara.femaleBody.customTexCtrlFace.SetColor(Manager.Character.Instance._Color6, chara.femaleCustomInfo.lipColor.rgbaDiffuse); chara.femaleCustom.LoatTextureInfo(CharaListInfo.TypeFemaleTexture.cf_t_lip, ref chara.femaleCustomInfo.texLipId, ref texture2D, ref texture, ref texture2); chara.femaleBody.customTexCtrlFace.SetTexture(Manager.Character.Instance._Texture6, texture2D); chara.femaleBody.customTexCtrlFace.SetColor(Manager.Character.Instance._Color7, chara.femaleCustomInfo.moleColor.rgbaDiffuse); chara.femaleCustom.LoatTextureInfo(CharaListInfo.TypeFemaleTexture.cf_t_mole, ref chara.femaleCustomInfo.texMoleId, ref texture2D, ref texture, ref texture2); chara.femaleBody.customTexCtrlFace.SetTexture(Manager.Character.Instance._Texture7, texture2D); chara.femaleBody.customTexCtrlFace.RebuildTextureAndSetMaterial(); }
public static void UpdateBody(CharFemale chara, bool body, bool bodyTatoo, bool bodySunburn) { Texture2D texture2D = null; Texture texture = null, texture2 = null; if (body) { chara.femaleBody.customTexCtrlBody.SetColor(Manager.Character.Instance._Color, chara.femaleCustomInfo.skinColor.rgbaDiffuse); chara.femaleBody.customMatBody.SetColor(Manager.Character.Instance._SpecColor, chara.femaleCustomInfo.skinColor.rgbSpecular); chara.femaleBody.customMatBody.SetFloat(Manager.Character.Instance._Metallic, chara.femaleCustomInfo.skinColor.specularIntensity); chara.femaleBody.customMatBody.SetFloat(Manager.Character.Instance._Smoothness, chara.femaleCustomInfo.skinColor.specularSharpness); chara.femaleCustom.LoatTextureInfo(CharaListInfo.TypeFemaleTexture.cf_t_body, ref chara.femaleCustomInfo.texBodyId, ref texture2D, ref texture, ref texture2); chara.femaleBody.customTexCtrlBody.SetMainTexture(texture2D); } if (bodyTatoo) { chara.femaleBody.customTexCtrlBody.SetColor(Manager.Character.Instance._Color3, chara.femaleCustomInfo.tattoo_bColor.rgbaDiffuse); chara.femaleCustom.LoatTextureInfo(CharaListInfo.TypeFemaleTexture.cf_t_tattoo_b, ref chara.femaleCustomInfo.texTattoo_bId, ref texture2D, ref texture, ref texture2); chara.femaleBody.customTexCtrlBody.SetTexture(Manager.Character.Instance._Texture3, texture2D); } if (bodySunburn) { chara.femaleBody.customTexCtrlBody.SetColor(Manager.Character.Instance._Color2, chara.femaleCustomInfo.sunburnColor.rgbaDiffuse); chara.femaleCustom.LoatTextureInfo(CharaListInfo.TypeFemaleTexture.cf_t_sunburn, ref chara.femaleCustomInfo.texSunburnId, ref texture2D, ref texture, ref texture2); chara.femaleBody.customTexCtrlBody.SetTexture(Manager.Character.Instance._Texture2, texture2D); } chara.femaleBody.customTexCtrlBody.RebuildTextureAndSetMaterial(); }
public static void FaceSlider(CharFemale chara, string[] partNames, int partIndex) { float newValue = AbsSlider(chara.customInfo.shapeValueFace[partIndex], partNames[partIndex]); if (Math.Abs(newValue - chara.customInfo.shapeValueFace[partIndex]) > 0.01F) { chara.chaCustom.SetShapeFaceValue(partIndex, newValue); } }
//TODO: figure out a way to do height while char's FK/IK is influenced by StudioNEOPlugin public static void BodySlider(CharFemale chara, string[] partNames, int partIndex) { float newValue = AbsSlider(chara.customInfo.shapeValueBody[partIndex], partNames[partIndex]); if (Math.Abs(newValue - chara.customInfo.shapeValueBody[partIndex]) > 0.01F) { chara.chaCustom.SetShapeBodyValue(partIndex, newValue); chara.femaleCustom.UpdateShapeBodyValueFromCustomInfo(); chara.femaleCustom.UpdateShapeBody(); } }
void LateUpdate() { var previousChara = CharacterPart.referenceChara; studio.cameraCtrl.enabled = !(windowMain.Contains(Event.current.mousePosition) || windowSub.Contains(Event.current.mousePosition)); studioChar = GetDamnChara(); CharacterPart.referenceChara = charaFemale = (studioChar != null) ? studioChar.charInfo as CharFemale : null; if (CharacterPart.referenceChara != previousChara) { somePart.ClearTheChain(); somePart.Init(); } }
public static void SetAllHair(CharFemale chara, HSColorSet color) { if (GUILayout.Button("Apply color to all hair")) { for (int i = 0; i < chara.femaleCustomInfo.hairColor.Length; i++) { chara.femaleCustomInfo.hairColor[i].SetDiffuseRGBA(color.rgbaDiffuse); chara.femaleCustomInfo.hairColor[i].SetSpecularRGB(color.rgbSpecular); chara.femaleCustomInfo.hairColor[i].specularIntensity = color.specularIntensity; chara.femaleCustomInfo.hairColor[i].specularSharpness = color.specularSharpness; chara.femaleCustom.ChangeHairColor(i); } } }
public override void Init(CharFemale _female, int _event) { _Base.Init(_female, _event); }