Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to get this working on Unity 5? #1

Open
worrel opened this issue Jun 5, 2015 · 4 comments
Open

Possible to get this working on Unity 5? #1

worrel opened this issue Jun 5, 2015 · 4 comments

Comments

@worrel
Copy link

worrel commented Jun 5, 2015

I've attempted to follow these steps for Unity 5.0.2 on Mac with no luck. One issue is the version of FSharp.Core.dll - there does not appear to be one for 2.3.0 as mentioned in the writeup. I've tried used one from 4.0 and 4.5 also with no luck. Even downloaded the DLL from this repo. But in all cases I can't seem to build the project & my .fs files show with errors in MonoDevelop.

@eriksvedang
Copy link
Owner

Oh, sorry to hear that. I haven't used Unity 5 more so I'm not sure. Please tell me if you figure something out and I can put it into the guide for everyone else! Also, I guess we're all hoping that they will bump the .NET version soon so that we can use a newer version of F# etc. That might take years though, they've just said it's gonna happen at some point in the future...

@worrel
Copy link
Author

worrel commented Jun 8, 2015

Actually I've figured this out now (on both 4.x and 5.x). The key was to stop trying to use F# DLLs installed by the Homebrew "fsharp" package, and exclusively use the libraries included with Unity in the MonoDevelop.app folder. To summarize:

For FSharp.Core, System and System.Core:
/Applications/<unity_4_or_5_folder>/MonoDevelop.app/Contents/Frameworks/Mono.framework/Home/lib/mono/2.0

For UnityEngine:
/Applications/<unity_4_or_5_folder>/Unity.app/Contents/Frameworks/Managed

For FSharp.Core, you need to set "Local Copy" on the reference, but not for the others. If you target the project directly into Assets, that's all you need to do. If you follow the custom build command approach, you need to make sure to copy both your library dll (MyFSharpLib.dll) and FSharp.Core to Assets (I created 2 separate after build custom commands for this).

@eriksvedang
Copy link
Owner

OK, great!

@McOmghall
Copy link

Using VS Unity Extensions you can compile directly using Unity as target (using maybe only web modules etc.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants