private void RecalculateSearchSphere() { Tank baseTech = base.Tech; if (baseTech) { TechVision vision = baseTech.Vision; if (vision) { TechVision_RecalculateSearchSphere.Invoke(vision, null); this.m_SearchEpicentre = (Vector3)TechVision_SearchEpicentre.GetValue(vision); this.m_SearchRadius = (float)TechVision_SearchRadius.GetValue(vision); } else { this.m_SearchEpicentre = Vector3.zero; foreach (ModuleVision moduleVision in this.m_VisionModules) { this.m_SearchEpicentre += moduleVision.block.centreOfMassWorld; } if (this.m_VisionModules.Count > 1) { this.m_SearchEpicentre /= (float)this.m_VisionModules.Count; } this.m_SearchRadius = 0f; foreach (ModuleVision moduleVision2 in this.m_VisionModules) { float b = (moduleVision2.block.centreOfMassWorld - this.m_SearchEpicentre).magnitude + moduleVision2.Range; this.m_SearchRadius = Mathf.Max(this.m_SearchRadius, b); } this.m_SearchEpicentre = base.Tech.trans.InverseTransformPoint(this.m_SearchEpicentre); } } }
public static void Postfix(ref TechVision __instance, ref ModuleVision vision) { OctantVision octantVision = __instance.GetComponent <OctantVision>(); if (octantVision) { octantVision.RemoveVision(vision); } return; }
public static bool Prefix(ref TechVision __instance, ref int team, ref Visible __result) { OctantVision octantVision = __instance.GetComponent <OctantVision>(); if (octantVision) { __result = octantVision.GetFirstVisibleTechIsEnemy(team); return(false); } return(true); }
public static void Postfix(ref TechVision __instance) { Console.WriteLine($"REFRESH STATE {__instance.Tech.name}"); }
public static void Postfix(ref TechVision __instance) { Console.WriteLine($"RECALCULATE SEARCH SPHERE {__instance.Tech.name}"); }