public static bool Prefix(HumanManager __instance, ref HumanAI __result, HumanConfiguration config, Vector3 position, Faction faction, bool alive = true, HumanAI.Serializable serial = null) { if (!PlannedParenthoodMod.InAddChild && config.humanType == HumanType.Colonist && config.ageLevel == AgeLevel.Child && serial == null) { PlannedParenthoodMod.InAddChild = true; GameObject fakeObj = new GameObject(); fakeObj.SetActive(false); HumanMonoBehaviour hMono = fakeObj.AddComponent <HumanMonoBehaviour>(); __result = new HumanAI(hMono, null, config, Int64.MaxValue); __result.mother.children.Remove(__result); __result.father.children.Remove(__result); return(false); } return(true); }
public static void SpawnHuman_Postfix(HumanManager __instance, ref HumanAI __result, HumanConfiguration config, Vector3 position, Faction faction, bool alive = true, HumanAI.Serializable serial = null) { if (UIImprovementsMod.Instance == null || UIImprovementsMod.Instance.AnimalCyclerPanel == null) { return; } if (__result != null && __result.faction != null && !__result.IsHumanoid() && __result.animal != null && __result.faction is ColonyFaction) { HumanType type = __result.humanType; UIImprovementsMod.Instance.AnimalCyclerPanel.UpdateUI(type); } }