Created
October 27, 2012 09:18
-
-
Save ApprenticeGC/3963720 to your computer and use it in GitHub Desktop.
Unity 3d editor plugin code in F#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Assembly_FSharp_vs | |
open UnityEditor | |
open UnityEngine | |
type public SomeTool() = | |
inherit UnityEditor.EditorWindow() | |
// | |
[<MenuItem("MySelection/Print Selection")>] | |
static member ShowWindow() = UnityEditor.EditorWindow.GetWindow(typeof<SomeTool>) | |
// | |
member this.OnGUI() = | |
if GUILayout.Button("Button") then this.Initialize() | |
// | |
member public this.Initialize() = | |
let selectedObjects = Selection.objects | |
for _ in selectedObjects do | |
Debug.Log("some object") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment