added sound script and menu

This commit is contained in:
Mausham
2025-12-12 16:16:37 -08:00
parent 2118bb7c36
commit 06ca472bb3
33 changed files with 1842 additions and 181 deletions

View File

@@ -1,18 +1,20 @@
using System;
using Unity.VisualScripting;
using UnityEngine;
using VContainer;
public class ScoreService
{
public Action<int> onScoreUpdate;
public int score { get; private set; }
public int HighScore = PlayerPrefs.GetInt("HighScore", 0);
[Inject] GameScreenController gameScreenController;
[Inject] StartScreenController startScreenController;
public void AddScore()
{
if (!startScreenController.hasGameStarted) return;
score += 5;
onScoreUpdate?.Invoke(score);
gameScreenController.UpdateScore(score);
if(score>HighScore)
{
SetHighScore();