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
42
Assets/Scripts/PopupController.cs
Normal file
42
Assets/Scripts/PopupController.cs
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class PopupController_Auto : MonoBehaviour
|
||||
{
|
||||
private GameObject popupPanel;
|
||||
private Button openButton;
|
||||
private Button closeButton;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
// Otomatik bulma
|
||||
popupPanel = GameObject.Find("PopupPanel");
|
||||
openButton = GameObject.Find("HelpButton").GetComponent<Button>();
|
||||
closeButton = GameObject.Find("CloseButton").GetComponent<Button>();
|
||||
|
||||
if (popupPanel == null)
|
||||
Debug.LogError("PopupPanel bulunamadı! İsmi tam olarak 'PopupPanel' olmalı.");
|
||||
|
||||
if (openButton == null)
|
||||
Debug.LogError("HelpButton bulunamadı! İsmi tam olarak 'HelpButton' olmalı.");
|
||||
|
||||
if (closeButton == null)
|
||||
Debug.LogError("CloseButton bulunamadı! İsmi tam olarak 'CloseButton' olmalı.");
|
||||
|
||||
popupPanel.SetActive(false);
|
||||
|
||||
// Eventleri otomatik bağlama
|
||||
openButton.onClick.AddListener(OpenPopup);
|
||||
closeButton.onClick.AddListener(ClosePopup);
|
||||
}
|
||||
|
||||
void OpenPopup()
|
||||
{
|
||||
popupPanel.SetActive(true);
|
||||
}
|
||||
|
||||
void ClosePopup()
|
||||
{
|
||||
popupPanel.SetActive(false);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue