Table of Contents

Class MapMagicLinuxBuildPreprocessor

Namespace
GrindFest.Editor
Assembly
GrindFest.dll

Strips the MM_NATIVE scripting define from Standalone builds whose target is StandaloneLinux64, and restores it after the build completes.

Why: MapMagic 2 P/Invokes a "NativePlugins" library (Win .dll / macOS .bundle) that has no Linux .so. Without this strip, the Linux player throws DllNotFoundException: NativePlugins as soon as terrain generation starts. MapMagic ships pure-C# fallbacks for every #if MM_NATIVE branch, so disabling the define makes Linux builds use the managed implementations transparently. Slower, but functional.

Targets and rationale:

  • This only modifies the Standalone defines, which is the group Linux64 builds belong to (alongside Win/Mac).
  • Win/Mac standalone builds keep MM_NATIVE for full native performance.
  • The original define string is restored in OnPostprocessBuild(BuildReport) so the Editor and subsequent builds are unaffected.
public class MapMagicLinuxBuildPreprocessor : IPreprocessBuildWithReport, IPostprocessBuildWithReport, IOrderedCallback
Inheritance
object
MapMagicLinuxBuildPreprocessor
Implements

Properties

callbackOrder

Returns a numeric value that determines the order in which the build callback is invoked.

Methods

OnPostprocessBuild(BuildReport)

Implement this function to receive a callback after the build is complete.

OnPreprocessBuild(BuildReport)

Implement this method to receive a callback before the build is started.