public CSObject CacheFunc(pfunc func) { CSObject o = new CSObject(); o.type = CSType.SHARPFUNCTION; o.v32 = cache.AddKey(func); return(o); }
public static int CallCSharp(int argc, [In, Out, MarshalAs(UnmanagedType.LPArray, SizeConst = maxArgs)] CSObject[] argv, int args, int res) { UnityEngine.Debug.Assert(argc > 0); CSObject o = argv[0]; if (o.type == CSType.SHARPFUNCTION) { pfunc f = (pfunc)cache.Get(o.v32); return(f(argc, argv, args, res)); } return(0); }
public JsonResult GetFuncsByRoleName(string rolename) { List <func> temp = null; List <object> ts = new List <object>(); try { temp = myPostRepo.GetAll_T_FuncInfo(rolename); foreach (func t in temp) { if (t.children == null || t.children.Count() == 0) { pfunc pc = new pfunc(); pc.url = t.url; pc.name = t.name; pc.icon = t.icon; pc.num = t.num; pc.pid = t.pid; object t2 = pc as Object; ts.Add(t2); } else { //pfunc pt = new pfunc(); //pt.url = t.url; //pt.name = t.name; //pt.icon = t.icon; //pt.num = t.num; object t1 = t as Object; ts.Add(t1); } } return(Json(new { success = "200", data = ts })); } catch (Exception ex) { return(Json(new { success = "404", error = ex.ToString() })); } }
public static extern IntPtr sharpc_alloc(pfunc func);
public static extern IntPtr sharpc_create(pfunc func);