public static void FaceBlendShapeLateUpdateHook() { Cyu cyu = CyuLoaderVR.mainCyu; if (cyu == null) { return; } cyu.LateUpdateHook(); }
public static void JudgeProcPre() { //This patch is only designed for caress mode, which only exists when there is a single girl in H //Therefore we only need the first Cyu object Cyu cyu = CyuLoaderVR.mainCyu; if (!cyu || cyu.flags.mode != HFlag.EMode.aibu) { return; } // If OrgasmAfterKiss is enabled, then we need to ensure that we do not revert back to an incorrect animation state if the girl // is being groped while kissing (see https://github.com/MayouKurayami/KK_CyuVR/pull/1#issuecomment-790853354). if (CyuLoaderVR.OrgasmAfterKiss.Value) { CyuLoaderVR.mainCyu.preventPrevAnimationSwap = true; } //If the last position in the array is filled, move it back one position and fill the last position with the current action //This ensures the last touched body part is always tracked in the last position of the array, //while the first position tracks any other body part that is being touched concurrently if (cyu.touchOrder.Last() != null) { cyu.touchOrder[cyu.touchOrder.Length - 2] = cyu.touchOrder[cyu.touchOrder.Length - 1]; } cyu.touchOrder[cyu.touchOrder.Length - 1] = cyu.flags.click; //If currently kissing, update back-to-idle animation to the current touched body part if (cyu.IsKiss) { switch (cyu.touchOrder.Last()) { case HFlag.ClickKind.muneL: case HFlag.ClickKind.muneR: Traverse.Create(cyu.aibu).Field("backIdle").SetValue(1); break; case HFlag.ClickKind.kokan: Traverse.Create(cyu.aibu).Field("backIdle").SetValue(2); break; case HFlag.ClickKind.siriL: case HFlag.ClickKind.siriR: case HFlag.ClickKind.anal: Traverse.Create(cyu.aibu).Field("backIdle").SetValue(3); break; } } }
public static void FinishActionPost() { //This patch is only designed for caress mode, which only exists when there is a single girl in H //Therefore we only need the first Cyu object Cyu cyu = CyuLoaderVR.mainCyu; if (!cyu || cyu.flags.mode != HFlag.EMode.aibu) { return; } //Find any entry in the touched body parts array that matches with the body part that was just released, and clear it int index = Array.LastIndexOf(cyu.touchOrder, cyu.flags.click - 6); if (index > -1) { Array.Clear(cyu.touchOrder, index, 1); } //While kissing and not in disengagement transition, update the back-to-idle animation to the last holding body part, //or set it to idle if no body part is currently being held. //It's too late to change the back-to-idle animation during disengagement transition, as the crossfade to the next animation has already begun //Changing the backIdle variable in this case would result in it being the wrong value and causing undesired behaviors if (cyu.IsKiss && cyu.kissPhase != Cyu.Phase.Disengaging) { switch (cyu.touchOrder.LastOrDefault(x => x != null)) { case HFlag.ClickKind.muneL: case HFlag.ClickKind.muneR: Traverse.Create(cyu.aibu).Field("backIdle").SetValue(1); break; case HFlag.ClickKind.kokan: Traverse.Create(cyu.aibu).Field("backIdle").SetValue(2); break; case HFlag.ClickKind.siriL: case HFlag.ClickKind.siriR: case HFlag.ClickKind.anal: Traverse.Create(cyu.aibu).Field("backIdle").SetValue(3); break; default: Traverse.Create(cyu.aibu).Field("backIdle").SetValue(0); break; } } }
public static void SpeedUpClickItemAibuPre(ref float _rateSpeedUp) { //This patch is only designed for caress mode, which only exists when there is a single girl in H //Therefore we only need the first Cyu object Cyu cyu = CyuLoaderVR.mainCyu; if (!CyuLoaderVR.GropeOverride.Value || !cyu || cyu.flags.mode != HFlag.EMode.aibu || !cyu.IsKiss) { return; } if (_rateSpeedUp > 1f) { _rateSpeedUp = 0.7f; return; } else { cyu.dragSpeed = Math.Max(cyu.dragSpeed, Mathf.Clamp(0.1f + (214.444f * _rateSpeedUp) - (7222.222f * _rateSpeedUp * _rateSpeedUp), 0.1f, 1.5f)); } }
internal static void InitCyu(HFlag flags) { hFlag = flags; lstFemale.Clear(); FindObjectsOfType <ChaControl>().ToList <ChaControl>().Where <ChaControl>(x => x.chaFile.parameter.sex == 1).ToList <ChaControl>().ForEach(female => { Cyu oldCyu = female.GetComponent <Cyu>(); if (oldCyu != null) { Destroy(oldCyu); } Cyu newCyu = female.gameObject.AddComponent <Cyu>(); newCyu.flags = flags; lstFemale.Add(female); if (lstFemale.Count < 2) { mainCyu = newCyu; } }); animationName = flags.nowAnimationInfo.nameAnimation; }