Ejemplo n.º 1
0
    IEnumerator Start()
    {
                #if UNITY_ANDROID && !UNITY_EDITOR
        GameObject go = GameObject.Find("AndroidManager");
        androidManager = go.GetComponent <UXAndroidManager> ();
        androidManager.InitAndroid();
                #endif
        //CommonUtil.ScreenSettingsPortrait();

        if (UXPlayerLauncherController.Instance.IsConnected() == true)
        {
            if (UXConnectController.GetRoomNumber() != -1)
            {
                UXConnectController.SetRoomNumber(-1);
            }
            UXPlayerLauncherController.Instance.Clear();
        }

        playerController = UXPlayerController.Instance;

        yield return(CommonLang.instance);

        //chineseButton.SetActive(true);
        //englishButton.SetActive(true);
        //logoImage.SetActive(true);
        //ChinaButton ();
        EnglishButton();

                #if UNITY_ANDROID && !UNITY_EDITOR
        infoText.text = androidManager.GetVersionName("com.cspmedia.gamepartyplayer") + "/" + ((ServerList)PlayerPrefs.GetInt("ServerList"));
                #endif
    }
Ejemplo n.º 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);
    }