Beispiel #1
0
    void Start()
    {
        Screen.orientation = ScreenOrientation.Portrait;
        Screen.SetResolution(720, 1280, true);

        //blackOut.SetActive(true);

        m_ClientController = UXClientController.Instance;
        m_PlayerController = UXPlayerController.Instance;

        PopupManager_RaS.IsFreeSetter(false);             // TOOD : PopupManager 공통 모듈로 바꿔야함

        userCode   = m_PlayerController.GetCode();        // 유저 코드 가져옴
        roomNumber = UXConnectController.GetRoomNumber(); // 방 번호 가져옴

        //blackOut.SetActive(false);

        //userCode = m_PlayerController.GetCode ();
        //launcherCode = UXClientController.GetRoomNumber();

        i_PlayerID = m_PlayerController.GetIndex();

        m_ClientController.OnConnected     += OnConnected;
        m_ClientController.OnConnectFailed += OnConnectFailed;
        m_ClientController.OnJoinSucceeded += OnJoinSucceeded;
        m_ClientController.OnJoinFailed    += OnJoinFailed;
        m_ClientController.OnDisconnected  += OnDisconnected;

        m_ClientController.OnUserAdded        += OnUserAdded;
        m_ClientController.OnUserRemoved      += OnUserRemoved;
        m_ClientController.OnUserLeavedInGame += OnUserLeaved;
        m_ClientController.OnNetworkReported  += OnNetworkReported;
        m_ClientController.OnUpdateReadyCount += OnUpdateReadyCount;

        m_ClientController.OnGameStart    += OnGameStart;
        m_ClientController.OnGameRestart  += OnGameRestart;
        m_ClientController.OnGameResult   += OnGameResult;
        m_ClientController.OnIndexChanged += OnIndexChanged;

        m_ClientController.OnUserListReceived += OnUserListReceived;
        m_ClientController.OnGameEnd          += OnGameEnd;
        m_ClientController.OnExit             += OnExit;
        m_ClientController.OnAckFailed        += OnAckFailed;
        m_ClientController.OnHostDisconnected += OnHostDisconnected;

        //inapp.OnPurchaseSuccess += OnPurchaseSuccess;

        //==========================================
        m_ClientController.OnHostJoined += OnHostJoined;
        m_ClientController.OnError      += OnError;
        m_ClientController.OnReceived   += OnReceived;
        //==========================================

        if (m_ClientController.IsConnected() == false)
        {
            m_ClientController.Connect();
        }
        else
        {
            //m_ClientController.Join("none");
            m_ClientController.Join(GAME_PACKAGE_NAME);
        }

        cancelButton.SetActive(false);

        DontDestroyOnLoad(this.gameObject);
    }
Beispiel #2
0
 void OnUserAdded(int userIndex, int userCode)
 {
     i_PlayerID = m_PlayerController.GetIndex();
     //Debug.Log("OnLobbyUserAdded > userIndex : " + userIndex + ",userCode : " + userCode + " , PlayerID : " + i_PlayerID);
 }