public static void Postfix(ThingWithComps __instance, Map map)
 {
     if (__instance is Plant)
     {
         MapComp_Noise noiseMap = map.GetComponent <MapComp_Noise>();
         if (noiseMap != null)
         {
             noiseMap.AddSoother(__instance, __instance.Position, -3);
         }
     }
 }
Ejemplo n.º 2
0
        public void UpdateSoother()
        {
            MapComp_Noise noiseMap = parent.Map?.GetComponent <MapComp_Noise>();

            if (noiseMap == null)
            {
                return;
            }
            bool shouldBeLitNow = ShouldBeOnNow;

            if (effectOn == shouldBeLitNow)
            {
                return;
            }
            effectOn = shouldBeLitNow;
            if (!effectOn)
            {
                noiseMap.ClearSoother(parent);
                return;
            }
            noiseMap.AddSoother(parent, parent.Position, Props.power, Props.maxLevel);
        }