Ejemplo n.º 1
0
        /// <summary>
        /// Run action on thread
        /// </summary>
        /// <param name="act"></param>Run in thread!!
        /// <param name="end_act"></param>Run In Monobehavior Update()
        /// <returns></returns>
        public ThreadCmd Run(Action act, Action end_act)
        {
            var cmd = new ThreadCmd();

            cmd.SetAction(act)
            .SetEndAction(end_act);
            ThreadPool.QueueUserWorkItem(RunCmd, cmd);
            m_Cmds.Add(cmd);
            return(cmd);
        }
Ejemplo n.º 2
0
        void RunCmd(object obj)
        {
            ThreadCmd cmd = obj as ThreadCmd;

            if (cmd == null)
            {
                //Interlocked.Decrement(ref m_ThreadCount);
                return;
            }
            cmd.I_Run();
        }