コード例 #1
0
    IEnumerator Start()
    {
        m_bReqAbort = false;
        m_bEnd      = false;

        UnityEngine.Debug.unityLogger.logEnabled = false;

        m_netcomm = new netcomm();
        m_netcomm.Start();

        //slagtool.util.SetLogFunc(wk.SendWriteLine,wk.SendWrite);

        slagremote.cmd.init();

        yield return(null);

        guiDisplay.WriteLine("slag monitor からコマンドを入力して下さい。" + System.Environment.NewLine);

        while (true)
        {
            if (m_bReqAbort)
            {
                break;
            }

            yield return(null);

            if (m_bReqAbort)
            {
                break;
            }

            var cmd = slagremote.cmd.GetNextCmd();
            if (cmd == null)
            {
                cmd = m_netcomm.GetCmd();
            }

            if (cmd == null)
            {
                continue;
            }
            slagremote.cmd.execute(cmd);
        }
        m_bEnd = true;
    }
コード例 #2
0
    IEnumerator _start_co()
    {
        m_start_done = false;

        m_bReqAbort  = false;
        m_abort_done = false;

        m_netcomm = new netcomm(m_runmode);
        m_netcomm.Start();

        slagremote.cmd.init();

        m_start_done = true; //スタート完了通知

        yield return(null);

        if (m_runmode == RUNMODE.NORMAL)
        {
            guiDisplay.WriteLine("slag monitor からコマンドを入力して下さい。" + System.Environment.NewLine);
        }

        while (true)
        {
            if (m_bReqAbort)
            {
                break;
            }

            yield return(null);

            if (m_bReqAbort)
            {
                break;
            }

            var cmd = slagremote.cmd.GetNextCmd();
            if (cmd == null)
            {
                cmd = m_netcomm.GetCmd();
            }

            if (cmd == null)
            {
                continue;
            }
            slagremote.cmd.execute(cmd);
        }
        m_bReqAbort = false;

        if (m_netcomm != null)
        {
            m_netcomm.Terminate();
            while (!m_netcomm.IsEnd())
            {
                yield return(null);
            }
            m_netcomm = null;
        }
        m_abort_done = true;
        m_start_done = false;
    }