#```
1 messages · Page 1 of 1 (latest)
How do you unlock a loaded ddl, my ddl file is locked as soon as I go into my unity and I would like it to get unlocked after the Init method is over
using System;
using UnityEngine;
using System.Reflection;
using System.Collections.Generic;
public static class RoslynBackgroundService
{
const string DdlPath = "C:\\Users\\kleme\\source\\repos\\CSharpSyntaxParserUnity\\bin\\Debug\\CSharpSyntaxParserUnity.dll";
static object yourClassInstance;
static MethodInfo taskFunction;
static object[] arguments;
static object Instance;
static List<string> Filters = new List<string>();
static public void Init(List<string> FilePaths)
{
//lock
Assembly assembly = Assembly.LoadFrom(DdlPath);
Type yourClassType = assembly.GetType("CSharpSyntaxParserUnity.Parser");
Instance = Activator.CreateInstance(yourClassType);
taskFunction = yourClassType.GetMethod("Init");
try
{
var result = taskFunction.Invoke(Instance, new object[] { FilePaths.ToArray() });
foreach (var ret in result as string[])
{
UnityEngine.Debug.Log(ret);
}
}catch
{
}
DeInit();
}
static public void DeInit()
{
yourClassInstance = null;
taskFunction = null;
arguments = null;
}
static public void SetArgs(List<string> filters)
{
Filters = filters;
}