void UpdateScore(bool kill, int addScores) { // make sound about hit to enemy _audioSource.PlayOneShot(_shootToEnemy); if (kill) { addScores += 50; } _scores += addScores; // kill last animation mySequence.Kill(); mySequence = DOTween.Sequence(); // set default position and size for text _scoresText.gameObject.transform.localPosition = new Vector3(-0.00028f, 0, 0.001414f); _scoresText.fontSize = 24; // show scores _scoresText.gameObject.SetActive(true); _scoresText.text = $"Попадание:\n+{addScores}"; // move scores up and make font smaller mySequence.Append(_scoresText.gameObject.transform.DOLocalMoveZ(0.005f, 2)).Append (DOTween.To(() => _scoresText.fontSize, x => _scoresText.fontSize = x, 0, 1.8f)); // add to record table lb.AddNewHighscore(playersNames[coltIndex], _scores); }
public void ResetCartMovement() { m_leaderBoard = GameObject.FindGameObjectWithTag("LeaderBoard").GetComponent <LeaderBoard>(); m_leaderBoard.AddNewHighscore(PhotonNetwork.NickName, m_distance / 10); m_progress = 0f; m_distance = 0; m_cartSpeed = 0; m_startPos = gameObject.transform.position; }
void Update() { if (playerArrived) { if (Input.GetButtonDown("Enter")) { player.currentHealth = 0; leaderboard.SetActive(true); LeaderBoard.AddNewHighscore(Username_Enter.username, (int)Timer.timer); } } }
private void OnCollisionEnter(Collision collision) { if ((collision.gameObject.tag == "DeadZone" || collision.gameObject.tag == "Enemy")) { if (m_photonView.IsMine) { isDead = true; LeaderBoard.AddNewHighscore(PhotonNetwork.NickName, Score.m_score); //m_targetSyst.m_arrow.SetActive(true); //m_targetSyst.Reload(); m_uIController.m_deathUI.SetActive(true); } } }