Ejemplo n.º 1
0
    void    OnGUI()
    {
        // 배경 이미지.
        int x = Screen.width / 2 - 80;
        int y = Screen.height / 2 - 20;


        if (this.step == STEP.WAIT_RESTART)
        {
            NotifyError();
            return;
        }

        if (m_client != null &&
            this.step >= STEP.WAIT_MATCHING &&
            this.step <= STEP.GAME_START)
        {
            m_client.OnGUIMatching();
        }

        if (this.step != STEP.WAIT)
        {
            return;
        }

        {
            GUIStyle style = new GUIStyle();
            style.fontSize         = 14;
            style.fontStyle        = FontStyle.Bold;
            style.normal.textColor = Color.black;

            //
            //GUI.Label(new Rect(x, y - 100, 160, 20), "ID 입력", style);
            //accountID = GUI.TextField(new Rect(x, y - 80, 160, 20), accountID);

            GUI.Label(new Rect(x, y - 50, 160, 20), "매칭 서버 주소", style);
            m_serverAddress = GUI.TextField(new Rect(x, y - 30, 160, 20), m_serverAddress);
        }

        if (GUI.Button(new Rect(x, y, 160, 20), "Connect to Server"))
        {
            this.next_step = STEP.MATCHING;
        }
    }
Ejemplo n.º 2
0
    void    OnGUI()
    {
        // 배경 이미지.
        int x = Screen.width / 2 - 80;
        int y = Screen.height / 2 - 20;

        GUI.DrawTexture(new Rect(0.0f, 0.0f, Screen.width, Screen.height), this.title_image);

        if (this.step == STEP.WAIT_RESTART)
        {
            NotifyError();
            return;
        }

        if (m_client != null &&
            this.step >= STEP.WAIT_MATCHING &&
            this.step <= STEP.GAME_START)
        {
            m_client.OnGUIMatching();
        }

#if UNUSE_MATCHING_SERVER
        if (this.step == STEP.WAIT_SYNC)
        {
            GUIStyle style = new GUIStyle();
            style.fontStyle        = FontStyle.Bold;
            style.normal.textColor = Color.black;
            style.fontSize         = 25;

            string label = "Connecting ";
            for (int i = 0; i < (count_ % 600) / 60; ++i)
            {
                label += ".";
            }

            GUI.Label(new Rect(x, y, 160, 20), label, style);
        }
#endif

        if (this.step != STEP.WAIT)
        {
            return;
        }

#if UNUSE_MATCHING_SERVER
        // 스탠드 얼론으로 매칭 서버를 경유하지 않을 때 사용.
        if (GUI.Button(new Rect(x, y, 160, 20), "두두장수로 플레이"))
        {
            m_isHost = true;
            GlobalParam.getInstance().global_account_id = 0;
            this.next_step = STEP.MATCHING;
        }
        if (GUI.Button(new Rect(x, y + 30, 160, 20), "콩장수로 플레이"))
        {
            GlobalParam.getInstance().global_account_id = 1;
            this.next_step = STEP.MATCHING;
        }
        if (GUI.Button(new Rect(x, y + 60, 160, 20), "풋콩장수로 플레이"))
        {
            GlobalParam.getInstance().global_account_id = 2;
            this.next_step = STEP.MATCHING;
        }
        if (GUI.Button(new Rect(x, y + 90, 160, 20), "볶은콩장수로 플레이"))
        {
            GlobalParam.getInstance().global_account_id = 3;
            this.next_step = STEP.MATCHING;
        }

        if (is_single)
        {
            if (this.next_step == STEP.MATCHING)
            {
                this.next_step = STEP.GAME_START;
            }
        }
#else
        {
            GUIStyle style = new GUIStyle();
            style.fontSize         = 14;
            style.fontStyle        = FontStyle.Bold;
            style.normal.textColor = Color.black;

            GUI.Label(new Rect(x, y - 50, 160, 20), "매칭 서버 주소", style);
            m_serverAddress = GUI.TextField(new Rect(x, y - 30, 160, 20), m_serverAddress);
        }

        if (GUI.Button(new Rect(x, y, 160, 20), "게임에서 논다"))
        {
            this.next_step = STEP.MATCHING;
        }
#endif
    }