Initial commit: Star of Words Unity project
Snapshot of the existing Unity 6 language-learning word game before any refactoring. Adds Unity .gitignore and .gitattributes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
commit
ecb1c9edea
1455 changed files with 933295 additions and 0 deletions
64
Assets/Scripts/MenuManager.cs
Normal file
64
Assets/Scripts/MenuManager.cs
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class MenuManager : MonoBehaviour
|
||||
{
|
||||
[Header("━━━ BUTONLAR ━━━━━━━━━━━━━━━━━━━━━━━━━")]
|
||||
public Button playButton;
|
||||
public Button wordsButton;
|
||||
public Button settingsButton;
|
||||
public Button tutorialButton;
|
||||
public Button leaderboardButton;
|
||||
public Button backButton;
|
||||
|
||||
[Header("━━━ SAHNE ADLARI ━━━━━━━━━━━━━━━━━━━━━")]
|
||||
public string playSceneName;
|
||||
public string backSceneName;
|
||||
|
||||
[Header("━━━ POPUP PANELLER ━━━━━━━━━━━━━━━━━━━")]
|
||||
public GameObject wordsPopup;
|
||||
public GameObject settingsPopup;
|
||||
public GameObject tutorialPopup;
|
||||
public GameObject leaderboardPopup;
|
||||
|
||||
[Header("━━━ CLOSE BUTONLAR ━━━━━━━━━━━━━━━━━━━")]
|
||||
public Button wordsClose;
|
||||
public Button settingsClose;
|
||||
public Button tutorialClose;
|
||||
public Button leaderboardClose;
|
||||
|
||||
void Start()
|
||||
{
|
||||
// Sahne geçişleri
|
||||
playButton.onClick.AddListener(() => LoadScene(playSceneName));
|
||||
backButton.onClick.AddListener(() => LoadScene(backSceneName));
|
||||
|
||||
// Popup açıcılar
|
||||
wordsButton.onClick.AddListener(() => OpenPopup(wordsPopup));
|
||||
settingsButton.onClick.AddListener(() => OpenPopup(settingsPopup));
|
||||
tutorialButton.onClick.AddListener(() => OpenPopup(tutorialPopup));
|
||||
leaderboardButton.onClick.AddListener(() => OpenPopup(leaderboardPopup));
|
||||
|
||||
// Popup kapatıcılar
|
||||
wordsClose.onClick.AddListener(() => ClosePopup(wordsPopup));
|
||||
settingsClose.onClick.AddListener(() => ClosePopup(settingsPopup));
|
||||
tutorialClose.onClick.AddListener(() => ClosePopup(tutorialPopup));
|
||||
leaderboardClose.onClick.AddListener(() => ClosePopup(leaderboardPopup));
|
||||
|
||||
// Hepsi başta kapalı
|
||||
wordsPopup.SetActive(false);
|
||||
settingsPopup.SetActive(false);
|
||||
tutorialPopup.SetActive(false);
|
||||
leaderboardPopup.SetActive(false);
|
||||
}
|
||||
|
||||
void OpenPopup(GameObject popup) => popup.SetActive(true);
|
||||
void ClosePopup(GameObject popup) => popup.SetActive(false);
|
||||
|
||||
void LoadScene(string sceneName)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(sceneName))
|
||||
SceneManager.LoadScene(sceneName);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue