Exemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     Panel_Main.SetActive(false);
     Panel_Login.SetActive(true);
     Btn_Score.SetActive(false);
     clientConnect = CSConnect.GetComponent <ClientConnect>();
     clientConnect.InitClientConnect();
     animator        = canvas.GetComponent <Animator>();
     scoreManager    = scoreBoardController.GetComponent <ScoreManager>();
     showMsgAnimator = Txt_ShowMsg.GetComponent <Animator>();
 }
Exemplo n.º 2
0
    void GameOver()
    {
        //set game state
        isPlaying = false;
        // Time.timeScale = 0;

        //save score
        scoreNum = PlayerManager.instance.player.GetComponent <PlayerStates>().scoreNum;
        dateTime = System.DateTime.Now.ToString();
        string value = "{\"account\":\"" + ClientLogin.account + "\",\"password\":\"" + ClientLogin.password + "\",\"score\":\"" + scoreNum + "\",\"time\":\"" + dateTime + "\"}";

        //connect to server
        clientConnect.InitClientConnect();
        clientConnect.SocketSender(value);
        StartCoroutine(ClientCloseConnect(1));

        //show and disappear UI and cursor
        Cursor.visible = true;
        health.SetActive(false);
        score.SetActive(false);
        countdownUI.SetActive(false);
        gameOverBoardManager.ShowBoard(scoreNum);
        gameOverBoardAnimator.SetBool("ShowGameOverBoard", true);
    }