You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to use this on Unity on Android, and I end up with error like this:
11-04 18:47:23.718 4156 4301 E Unity : TypeLoadException: Could not load type of field 'CSScriptLib.Runtime:CreateUnloadableAssemblyLoadContext' (2) due to: Could not resolve type with token 0100003e from typeref (expected class 'System.Runtime.Loader.AssemblyLoadContext' in assembly 'System.Runtime.Loader, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') assembly:System.Runtime.Loader, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:System.Runtime.Loader.AssemblyLoadContext member:(null)
11-04 18:47:23.718 4156 4301 E Unity : at CSScriptLib.CodeDomEvaluator+<>c__DisplayClass7_0.<ReferenceAssembly>b__0 (System.String x) [0x00000] in <2d2b17d233f24918b1e8f6536596dfe2>:0
11-04 18:47:23.718 4156 4301 E Unity : at System.Linq.Enumerable.TryGetFirst[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate, System.Boolean& found) [0x0003f] in <22d097c9c77e4fb3988dec23d55249ed>:0
11-04 18:47:23.718 4156 4301 E Unity : at System.Linq.Enumerable.FirstOrDefault[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) [0x00000] in <22d097c9c77
However, it runs completely fine on windows, here my code is:
IScriptscript=(IScript)CSScript.Evaluator.LoadCode((string)Skins.ReadSkin().Properties[AssignedObject.name][Resource.keyRefrence["Execute"]]);AssignedObject.GetComponent<Button>().onClick.AddListener(delegate{script.Execute(AssignedObject);});// Can be turned into this(simplified code): --------------------------------------------------------IScriptscript=(IScript)CSScript.Evaluator.LoadCode("using System; using UnityEngine; using UnityEngine.SceneManagement; class Script : IScript { public void Execute(GameObject obj) { SceneManager.LoadScene(\"Settings\"); } }"//sorry for 1 line code);script.Execute(GameObjectHere);// type GameObject is defined in UnityEngine// interface IScript -------------------------------------------------------publicinterfaceIScript{publicvoidExecute(GameObjectobj);}
Also I tried both roslyn and codedom evaluator, neither of them works.
btw, what I'm trying to do is make a scripting engine on my game, which user can define what to do when button clicked.
Configuration:
Mono compiler(didn't try il2cpp because obviously it wouldn't work), android 11 with root access, 6g ram on phone, Unity 2022.3.10f1
ps: if i didnt reply for a long time its prob because 11.5hrs of school every weekday 😭
The text was updated successfully, but these errors were encountered:
I tried to use this on Unity on Android, and I end up with error like this:
However, it runs completely fine on windows, here my code is:
Also I tried both roslyn and codedom evaluator, neither of them works.
btw, what I'm trying to do is make a scripting engine on my game, which user can define what to do when button clicked.
Configuration:
Mono compiler(didn't try il2cpp because obviously it wouldn't work), android 11 with root access, 6g ram on phone, Unity 2022.3.10f1
ps: if i didnt reply for a long time its prob because 11.5hrs of school every weekday 😭
The text was updated successfully, but these errors were encountered: