Tutorials ‐ Using custom scripts - ow-mods/outer-wilds-unity-wiki GitHub Wiki
- Build your mod
- Take the .dll file from your mod (in
%APPDATA%\OuterWildsModManager\OWML\Mods\[your mod name]) and copy/drag it into your unity project (anywhere will do, as long as it's somewhere inAssets. I like putting mine inAssets/Dlls.) - If your mod dll references other dlls (e.g. if your mod uses code from New Horizons), you also need to copy the other dlls into your unity project.
- If it loads without errors, you should be able to add your scripts to GameObjects in editor!
- In your .csproj.user file, add this property in the
<PropertyGroup>block:
<UnityDllsDir>[path to folder in unity project]</UnityDllsDir>This defines the folder you want to copy the dll to.
- In your .csproj file, add this in the
<Project>block:
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="Exists('$(UnityDllsDir)')">
<Exec Command="xcopy /y "$(TargetPath)" "$(UnityDllsDir)"" />
</Target>This tells the compiler to copy your dll (TargetPath) into where you specified earlier (UnityDllsDir) after building the dll.