Beispiel #1
0
    // Start is called before the first frame update
    void Start()
    {
        //화면 셋팅 구문(꼭 필요한건 지는 모르겠다. 추후 조사 필요)
        //Screen.SetResolution(Screen.width, Screen.width, true);

        m_InfoManager = GameObject.Find("InfoManager").GetComponent <SC_InfoManager>();
    }
    void Init()
    {
        //InfoManager 가져온다.
        m_InfoManager = GameObject.Find("InfoManager").GetComponent <SC_InfoManager>();

        //싱글플레이
        if (m_InfoManager.m_client == null)
        {
            m_isMultiPlay = false;
        }
        //멀티플레이
        else
        {
            m_isMultiPlay = true;
        }


        //맵 몇번 맵인지 받아온다.
        m_mapassetName = m_InfoManager.m_mapName;

        //맵 못받아오면 에러 처리한다.
        if (m_mapassetName == "null")
        {
            Debug.LogError("Error : map is not setting!");
            return;
        }

        //====================================================================================시분초 초기화
        m_second      = 0;
        m_minuate     = 0;
        m_millisecond = 0.0f;

        m_lapsecond      = 0;
        m_lapminuate     = 0;
        m_lapmillisecond = 0.0f;
        //====================================================================================

        //====================================================================================바퀴수 셋팅
        m_nowAroundNumber = 0;
        m_maxAroundNumber = 1;
        m_around.text     = m_nowAroundNumber.ToString();
        m_maxaround.text  = m_maxAroundNumber.ToString();
        //====================================================================================


        m_spawnIndex = 0;

        //시네마틱 카메라가 나오기 때문에, 아직 플레이 하면 안된다.
        m_isPlay = false;

        m_FPS30       = FPS30();
        m_isFPS30Play = false;

        m_SecondsToGameOver          = SecondsToGameOver();
        m_isSecondsToGameOverPlaying = false;
    }
    private void OnEnable()
    {
        m_isDisableByGame = false;

        m_InfoManager = GameObject.Find("InfoManager").GetComponent <SC_InfoManager>();

        m_messageList = MessageQueue.GetInstance;

        //방목록을 담을 스크롤뷰를 가져온다. 방이 추가되면 맨밑으로 셋팅하기위해서 가져온다.
        //m_scroll_RoomList = transform.Find("Scroll View_RoomList").gameObject.GetComponent<ScrollRect>();

        //방이 생성될 부모 오브젝트
        //m_prefabRoomListContent_Parent = transform.Find("Scroll View_RoomList").Find("Viewport").Find("Content").gameObject;

        //============================================================================레이싱게임 서버에 접속한다. 대기방에 접속한다.

        String IP = "49.247.131.35"; // 접속 할 서버 아이피를 입력

        int port = 8888;             // 포트

        m_client = new TcpClient();

        m_client.Connect(IP, port);

        m_clientStream = m_client.GetStream();

        m_isConnected = true;

        ReceiveThread = new Thread(new ThreadStart(Receive));

        ReceiveThread.Start();

        Debug.Log("[ 49.247.131.35 서버 접속 ]");

        //============================================================================처음 접속했을때 필요한 메세지를 보낸다.

        //NICKNAME:유저닉네임/차AssetName/바퀴AssetName/날개AssetName
        C2S_SendMessage("NICKNAME:" + m_InfoManager.m_nickname + "/" + m_InfoManager.m_carAssetName + "/" + m_InfoManager.m_wheelAssetName + "/" + m_InfoManager.m_wingAssetName);

        //방목록을 받는다.
        C2S_SendMessage("ROOMLISTSHOW:");

        //============================================================================
        m_nickName = m_InfoManager.m_nickname;



        //============================================================================인게임에 넘어갈때 가지고 갈 네트워크 자원 넘겨준다.
        m_InfoManager.m_client       = m_client;
        m_InfoManager.m_clientStream = m_clientStream;
    }
    private void Start()
    {
        m_InfoManager = GameObject.Find("InfoManager").GetComponent <SC_InfoManager>();

        m_mapList  = new List <C_map>();
        m_rankList = new List <GameObject>();

        StartCoroutine(S2C_MapData());

        m_mapIndex  = 0;
        m_mapPrefab = Instantiate(Resources.Load("Map/" + m_mapIndex.ToString()), new Vector3(0, 0, 0), Quaternion.identity) as GameObject;

        StartCoroutine(S2C_RankList(m_mapIndex));
    }
    // Start is called before the first frame update
    void Start()
    {
        m_InfoManager = GameObject.Find("InfoManager").GetComponent <SC_InfoManager>();

        m_messageList = MessageQueue.GetInstance;

        if (m_InfoManager.m_client == null || m_InfoManager.m_clientStream == null)
        {
            Debug.LogError("소켓 연결 실패!");
            return;
        }

        m_client       = m_InfoManager.m_client;
        m_clientStream = m_InfoManager.m_clientStream;
        m_isConnected  = true;

        m_Thread_Receive = new Thread(new ThreadStart(ReceiveThreading));

        m_Thread_Receive.Start();
    }
Beispiel #6
0
    // Start is called before the first frame update
    void Start()
    {
        m_InfoManager = GameObject.Find("InfoManager").GetComponent <SC_InfoManager>();

        StartCoroutine(this.S2C_WingList_All());
    }
    ////방목록->방만들기 버튼을 누르면 방만들기 팝업창이 생성된다.
    //public GameObject m_Popup_RoomMake;
    //public GameObject m_Popup_RoomMakeParent;

    ////방목록->방선택 버튼을 누르면 채팅방 팝업창이 생성된다.
    //public GameObject m_Popup_RoomChatting;
    //public GameObject m_Popup_RoomChattingParent;

    //============================================================================================================
    // Start is called before the first frame update
    void Start()
    {
        m_InfoManager = GameObject.Find("InfoManager").GetComponent <SC_InfoManager>();

        StartCoroutine(S2C_UserData());
    }