public void WriteToCSharp(string directoryPath)
    {
        CSharpCodeWriter codeWriter = new CSharpCodeWriter();


        codeWriter.CreateNameSpace($"FuncGraphCompiled._{GraphName}", true);
        codeWriter.CurrentClass = new Class(GraphName, nameSpace: codeWriter.CurrentNamespace);
        codeWriter.CurrentClass.AddInterface(typeof(IDensityFunc).Name);

        codeWriter.CurrentClass.AddUsingDirective(new UsingDirective(nameof(System)));
        codeWriter.CurrentClass.AddUsingDirective(new UsingDirective(nameof(System) + "." + nameof(System.Collections)));
        codeWriter.CurrentClass.AddUsingDirective(new UsingDirective(nameof(System) + "." + nameof(System.Collections) + "." + nameof(System.Collections.Generic)));
        codeWriter.CurrentClass.AddUsingDirective(new UsingDirective(nameof(UnityEngine)));


        var ctor = codeWriter.CurrentClass.CreateACtor();

        codeWriter.CurrentCtor = ctor;
        //TODO make things that have public as to string, maybe base types as well, get way to easier get the density func interface function
        codeWriter.CurrentFunction = new Function(
            "public",
            "float",
            "Evaluate",
            new List <Parameter>()
        {
            new Parameter(typeof(SamplePointVariables).Name, "x"),
            new Parameter(typeof(SamplePointVariables).Name, "y"),
            new Parameter(typeof(SamplePointVariables).Name, "z")
        });
        codeWriter.CurrentLine = new ReturnLine();

        RootNode.WriteToCSharp(codeWriter);

        codeWriter.FinishCurrentFunction();

        codeWriter.FinishCurrentConstructor(false);

        codeWriter.WriteToDirectory(directoryPath);
    }