- Increased SFX pool size from 8 to 16 in AudioManager - Enabled preloadAudioData for multiple SFX files - Removed unused VisualScripting import from Checkpoint script - Reordered using statements in several scripts for consistency - Added CoinCollectible component to Coin prefab with pickup effects - Updated sorting layers and mesh LOD settings in Coin prefabs - Fixed typo in Interfaces.cs: optionaAttachPoint to optionalAttachPoint - Modified AddCoin method to accept count parameter and handle coin overflow - Moved projectile scripts (BasicProjectile, EnemyBasicProjectile, PhysicsProjectile, PickableProjectile) - Cleaned up unused namespaces and imports across various scripts
51 lines
1.3 KiB
C#
51 lines
1.3 KiB
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
using RR.Game2D.Core.Managers;
|
|
|
|
namespace RR.Common.UI
|
|
{
|
|
public class MainMenu : MonoBehaviour
|
|
{
|
|
[Header("Кнопки")]
|
|
[SerializeField] private Button newGameButton;
|
|
[SerializeField] private Button quitButton;
|
|
|
|
private void Start()
|
|
{
|
|
Bootstrap();
|
|
|
|
if (Application.platform == RuntimePlatform.WebGLPlayer)
|
|
{
|
|
quitButton.gameObject.SetActive(false);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Метод для загрузки элементов сцены.
|
|
/// Вешает события на кнопки
|
|
/// </summary>
|
|
public void Bootstrap()
|
|
{
|
|
if (newGameButton) newGameButton.onClick.AddListener(OnNewGame);
|
|
if (quitButton) quitButton.onClick.AddListener(OnQuit);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Метод начала новой игры
|
|
/// </summary>
|
|
private void OnNewGame()
|
|
{
|
|
|
|
GameManager.Instance.NewGame();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Метод выхода из игры
|
|
/// </summary>
|
|
private void OnQuit()
|
|
{
|
|
Application.Quit();
|
|
}
|
|
}
|
|
} |