Exemplo n.º 1
0
 [HarmonyPriority(-10000)] // Extremely low priority. We want this to happen last, since this will only overwrite FanRotatablePassiveElementConsumer variable
 public static void Prefix(ElementConsumer __instance)
 {
     if (__instance is FanRotatablePassiveElementConsumer)
     {
         Vector3   rotatableCellOffset = ((FanRotatablePassiveElementConsumer)__instance).rotatableCellOffset;
         Rotatable rotatable           = __instance.GetComponent <Rotatable>();
         if (rotatable != null)
         {
             __instance.sampleCellOffset = Rotatable.GetRotatedOffset(rotatableCellOffset, rotatable.GetOrientation());
         }
     }
 }
Exemplo n.º 2
0
 [HarmonyPriority(-10000)] // Extremely low priority. We want this to happen last, since this will only overwrite RotatableElementConsumer variable
 public static void Prefix(ElementConsumer __instance)
 {
     if (__instance is RotatableElementConsumer)
     {
         Vector3   rotatableCellOffset = ((RotatableElementConsumer)__instance).rotatableCellOffset;
         Rotatable rotatable           = __instance.GetComponent <Rotatable>();
         if (rotatable != null)
         {
             __instance.sampleCellOffset = Rotatable.GetRotatedOffset(rotatableCellOffset, rotatable.GetOrientation());
         }
         //Debug.Log("GetSampleCell call " + rotatableCellOffset + ", " + __instance.sampleCellOffset);
     }
 }