예제 #1
0
    void Start()
    {
        CommonUtil.ScreenSettingsPortrait();
        //numberPad.SetActive(false);

#if UNITY_ANDROID
        qrScannerButton.SetActive(true);
#elif UNITY_IOS
        qrScannerButton.SetActive(false);
#endif
        clientController = UXClientController.Instance;

        commonLang = CommonLang.instance;
        //Debug.Log (commonLang.langList.Count);
        noti.text = commonLang.langList[1];

        clientController.OnConnected     += OnConnected;
        clientController.OnConnectFailed += OnConnectFailed;

        clientController.OnJoinSucceeded += OnJoinSucceeded;
        clientController.OnJoinFailed    += OnJoinFailed;
        clientController.OnDisconnected  += OnDisconnected;

        if (clientController.IsConnected() == false)
        {
            serverConnect.SetActive(true);
            clientController.Connect();
        }

        if (string.IsNullOrEmpty(qrString) == false)
        {
            UXConnectController.SetRoomNumber(int.Parse(qrString));
            clientController.Join("com.cspmedia.runandsteal");
        }

        if (latest_errCode != -1)
        {
            OnJoinFailed(latest_errCode);
            isCon          = true;
            latest_errCode = -1;
        }
    }
예제 #2
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);
    }