Beispiel #1
0
        /// <summary>
        /// Call this method to try to run the routine if the interval is ok
        /// </summary>
        public void RunRoutine()
        {
            if (IntervalInMs <= 0 || _stopwatch.ElapsedMilliseconds > IntervalInMs)
            {
                Profiler.BeginSample(MethodName);

                Method.Invoke();

                _stopwatch.Reset();
                _stopwatch.Start();

                Profiler.EndSample();
            }
        }
Beispiel #2
0
        static int __CreateInstance(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                if (LuaAPI.lua_gettop(L) == 1)
                {
                    UnityEngine.Profiler __cl_gen_ret = new UnityEngine.Profiler();
                    translator.Push(L, __cl_gen_ret);
                    return(1);
                }
            }
            catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Profiler constructor!"));
        }