Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can F# be used with Unity (game engine)?

Tags:

unity3d

I'm getting into Unity, and wondering if I can use F# instead of C#, simply because I prefer the syntax. I'm guessing not, since the environment it runs on is very different, but maybe there's something that will cross-compile code or something else I'm not thinking of.

like image 738
ryanwebjackson Avatar asked Apr 27 '17 20:04

ryanwebjackson


People also ask

Was Kevin can f himself Cancelled?

Season 1 focused heavily on this conceit, with Allison McRoberts (Murphy) desperate to kill her bumbling, one-note sitcom stereotype husband Kevin (Eric Petersen) in order to free herself. But with the Season 1 finale, and the reveal that AMC was canceling the show after Season 2, a shift was felt.

Will there be a 2nd season of Kevin can f himself?

The second season will debut at 9 p.m. Monday, August 22, with the first two episodes available on AMC+. Additionally, AMC+ subscribers will have advance access to an additional episode each week.

What is the plot of Kevin can f himself?

Plot. Set in Worcester, Massachusetts, the show explores the life of Allison McRoberts (played by Annie Murphy), a woman struggling to redefine her life amid an unhappy marriage to her husband Kevin, an insensitive, unambitious man-child.


1 Answers

I can't help but get the impression that the other answers were written by people who do not really know what they are talking about.

This is what you need to do to use F# in a Unity project:

  1. Create an F# project that compiles into a dll. Have it build into the assets folder of a Unity project.
  2. Add references to UnityEngine.dll and/or UnityEditor.dll. Change the reference properties so the dlls aren't copied to the build folder. Of course you can't create new F# classes from within the Unity editor this way, but you can assign the ones you wrote in F#.

Currently you need to enable the (experimental) support for .NET-version 4.5. Alternatively you can download an older version of the FSharp.Core.dll that supports .NET 3.5. (see here).

I can't guarantee that you won't run into trouble because of compatibility issues with the FSharp.Core.dll, but that's just a guess since I haven't tested it myself.

like image 71
Lars Kokemohr Avatar answered Oct 20 '22 01:10

Lars Kokemohr