예제 #1
0
    public void Init()
    {
        errorManager = ErrorManager.GetInstance();

        appplyButton   = transform.FindChild("applyButton").GetComponent <Button>();
        closeButton    = transform.FindChild("closeButton").GetComponent <Button>();
        userInputField = transform.FindChild("userInputField").GetComponent <InputField>();
        //       passwordInputField = transform.FindChild("passwordInputField").GetComponent<InputField>();

        appplyButton.onClick.AddListener(OnAppplyButton);
        closeButton.onClick.AddListener(OnCloseButton);

        loginUI = LoginUI.GetInstance();
        Hide();
    }
예제 #2
0
    void Awake()
    {
        LoadXml.LoadTheXml();
        uiList = new List <BaseUI>();

        duelFieldUI = Resources.Load("Prefebs/DuelFieldUI") as GameObject;
        prepareUI   = Resources.Load("Prefebs/PrepareUI") as GameObject;

        editCardUI = EditUI.GetInstance();
        editCardUI.SetName(ComStr.UI_EditCardUI);
        loginUI = LoginUI.GetInstance();
        loginUI.SetName(ComStr.UI_LoginUI);
        gameHallUI = GameHallUI.GetInstance();
        gameHallUI.SetName(ComStr.UI_GameHallUI);


        uiList.Add(editCardUI);
        uiList.Add(loginUI);
        uiList.Add(gameHallUI);
    }
예제 #3
0
    private void OnBackendAuthorized()
    {
        Enqueue(Backend.BMember.GetUserInfo, callback =>
        {
            if (!callback.IsSuccess())
            {
                Debug.LogError("유저 정보 불러오기 실패\n" + callback);
                loginSuccessFunc(false, string.Format(BackendError,
                                                      callback.GetStatusCode(), callback.GetErrorCode(), callback.GetMessage()));
                return;
            }
            Debug.Log("유저정보\n" + callback);

            var info = callback.GetReturnValuetoJSON()["row"];
            Debug.Log(info["nickname"]);
            if (info["nickname"] == null)
            {
                Debug.Log("gd");
                LoginUI.GetInstance().ActiveNickNameObject();

                return;
            }


            myNickName = info["nickname"].ToString();
            myIndate   = info["inDate"].ToString();

            if (loginSuccessFunc != null)
            {
                MatchManager.GetInstance().GetMatchList(loginSuccessFunc);
                loginSuccessFunc(true, string.Empty);
            }

            SceneManager.LoadScene("Matching");
        });
    }
예제 #4
0
        public void DisplayGameOver1()
        {
            localPlayer.enabled      = false;
            localPlayer.disableInput = true;

            int highestScore = 0;
            int teamIndex    = 0;

            List <int> tempScoreArray = new List <int>();

            bool isADraw = false;

            highestScore = score.Max();
            teamIndex    = score.ToList().IndexOf(highestScore);

            foreach (int x in score)
            {
                tempScoreArray.Add(x);
            }
            tempScoreArray.RemoveAt(teamIndex);
            int highestScore1 = tempScoreArray.Max();
            int teamIndex1    = tempScoreArray.ToList().IndexOf(highestScore1);

            if (highestScore == 0)
            {
                isADraw = true;
            }
            else if (highestScore == highestScore1)
            {
                isADraw = true;
            }
            else
            {
                isADraw = false;
            }



            ui.SetGameOverText(teams[teamIndex], isADraw);

            if (localPlayer.myName == teams[teamIndex].name)
            {
                //LoginUI.GetInstance().UserAuthentication();

                GameObject lobbyManager = GameObject.Find("LobbyManager");

                int playerScore = lobbyManager.GetComponent <LobbyManager>().playerScore;

                Debug.Log("player score is: " + playerScore.ToString());

                playerScore++;

                Debug.Log("player score is: " + playerScore.ToString());

                //UpdateScore(playerScore.ToString());

                GameObject loginPanel = GameObject.Find("LoginPanel");

                //loginPanel.GetComponent<LoginUI>().UpdateScore(playerScore.ToString());

                LoginUI.GetInstance().UpdateScore(playerScore.ToString());

                //GameManager.GetInstance().localPlayer

                Debug.Log("Yay..");
            }
            else
            {
                Debug.Log("Dun be sad.." + localPlayer.name + " OMG - " + teams[teamIndex].name);
            }
            //starts coroutine for displaying the game over window
            StartCoroutine(DisplayGameOver());
        }