Advertisement
Guest User

Untitled

a guest
Mar 29th, 2020
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.89 KB | None | 0 0
  1. [HarmonyPostfix, HarmonyPatch(typeof(H_Lookat_dan), "setInfo")]
  2.         private static void LateReplaceKokan(H_Lookat_dan __instance, System.Text.StringBuilder ___assetName)
  3.         {
  4.             if (__instance.transLookAtNull == null)
  5.                 return;
  6.  
  7.  
  8.             lookAtFemale = __instance.transLookAtNull.transform.GetComponentInParent<AIChara.ChaControl>();
  9.             if (lookAtFemale == null)
  10.             {
  11.                 Console.WriteLine("Female is null");
  12.             }
  13.             else
  14.             {
  15.                 newLookAtTarget = lookAtFemale.GetComponentsInChildren<Transform>().Where(x => x.name.Contains("cervix")).FirstOrDefault();
  16.                 Console.WriteLine("newLookAtTarget is " + newLookAtTarget.name);
  17.             }
  18.             if (newLookAtTarget == null)
  19.             {
  20.                 Console.WriteLine("Previous is null");
  21.             }
  22.  
  23.             var fOpen = BepInEx.Paths.PluginPath + "/PVCollider.Exclusions.txt";
  24.             excludedPoses = System.IO.File.ReadAllLines(fOpen).ToList();
  25.             Console.WriteLine("List of excluded poses to retarget penis at:");
  26.             if (excludedPoses != null)
  27.             {
  28.                 foreach (var item in excludedPoses)
  29.                     Console.WriteLine(item);
  30.             }
  31.             else
  32.             {
  33.                 Console.Write(fOpen + " not found");
  34.             }
  35.  
  36.             poseName = ___assetName.ToString();
  37.             Transform lookatTarget = __instance.transLookAtNull;
  38.             Console.WriteLine(lookatTarget.name);
  39.             if (excludedPoses.Contains(poseName))
  40.             {
  41.                 Console.WriteLine("Pose " + poseName + " found in exclusion list, aborting");
  42.             }
  43.             else
  44.             {
  45.                 if (lookatTarget.name.Contains("k_f_kokan_00"))
  46.                 {
  47.                     Console.WriteLine("Target set to " + lookatTarget.name + ". Changing...");
  48.                     if (lookAtFemale != null)
  49.                     {
  50.  
  51.                         if (newLookAtTarget != null)
  52.                         {
  53.                             __instance.transLookAtNull = newLookAtTarget;
  54.                             __instance.dan_Info.SetTargetTransform(newLookAtTarget);
  55.                             Console.WriteLine("New target is " + __instance.transLookAtNull.name);
  56.                         }
  57.                         else
  58.                         {
  59.                             Console.WriteLine("Could not find any additional vagina target, leaving as is");
  60.                         }
  61.                     }
  62.                 }
  63.                 if (lookatTarget != null)
  64.                 {
  65.                     PenisOffset = new Vector3(lookatTarget.position.x + _lookAtTargetOffset_x.Value, lookatTarget.position.y + _lookAtTargetOffset_y.Value, lookatTarget.position.z + _lookAtTargetOffset_z.Value);
  66.                 }
  67.  
  68.             }
  69.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement