Exemplo n.º 1
0
        public static string CallFunctionDelegate(IntPtr name, IntPtr argv, int argc, out bool result)
        {
            string _name = Marshal.PtrToStringAnsi(name);

            string[] strings = null;
            if (argv != IntPtr.Zero)
            {
                strings = CustomMarshalling.IntPtrToStringArray(argv, argc);
            }
            return(EngineCallbacks.CallScriptFunction(_name, strings, out result));
        }
Exemplo n.º 2
0
        public static string CallMethodDelegate(IntPtr className, uint obj, IntPtr name, IntPtr argv, int argc,
                                                out bool result)
        {
            string _className = Marshal.PtrToStringAnsi(className);
            string _name      = Marshal.PtrToStringAnsi(name);

            SimObject objectWrapper = new SimObject(obj);

            string[] strings = {};
            if (argv != IntPtr.Zero)
            {
                strings = CustomMarshalling.IntPtrToStringArray(argv, argc);
            }
            string strRes = EngineCallbacks.CallScriptMethod(_className, objectWrapper, _name, strings, out result);

            if (!result)
            {
                strRes = EngineCallbacks.CallScriptMethod(_className, objectWrapper, _name, strings, out result);
            }
            return(strRes);
        }