public void AddCmp(Type cmp) { ContextSwitchInterpreter inter = new ContextSwitchInterpreter(cmp, Engine); Debug.Log("context " + inter.Engine); ops.AddInterpreter(NameTranslator.ScriptNameFromCSharp(cmp.Name), inter); }
public void OnCompiled(Assembly asm) { //AppDomain.CurrentDomain.Load (asm.GetName ()); //asm.GetName ().SetPublicKeyToken (new byte[]{ 12, 13, 48, 2 }); Debug.LogWarning(asm.FullName); Engine.AddAssembly(asm); //asm.GetName(). var type = Engine.GetType("External"); type.GetMethod("Init").Invoke(null, null); foreach (var provider in providers) { Debug.LogWarning(provider.Name); //Debug.LogWarning (provider.Instance); type.GetField(provider.Name, BindingFlags.NonPublic | BindingFlags.Static).SetValue(null, provider.Instance); //Debug.LogWarning (type.GetField (provider.Name, BindingFlags.NonPublic | BindingFlags.Static).GetValue (null)); } Ctx = new ContextSwitchInterpreter(type, Engine); if (onCompiled != null) { onCompiled(); } }
public override void Init() { ops = Engine.GetPlugin <EventFunctionOperators> (); var components = Engine.FindTypesCastableTo <MonoBehaviour> (); MaxProgress = components.Count; foreach (var cmp in components) { CurProgress++; ContextSwitchInterpreter inter = new ContextSwitchInterpreter(cmp, Engine); //if (ScriptEngine.AnalyzeDebug) // Debug.Log ("context " + inter.Engine); ops.AddInterpreter(NameTranslator.ScriptNameFromCSharp(cmp.Name), inter); } CurProgress = MaxProgress; var goInter = new ContextSwitchInterpreter(typeof(GameObject), Engine); }