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:
portakal 2026-07-05 15:31:20 +03:00
commit ecb1c9edea
1455 changed files with 933295 additions and 0 deletions

View file

@ -0,0 +1,41 @@
using UnityEngine;
public class MusicManager : MonoBehaviour
{
[Header("━━━ MÜZIKLER (25 MP3) ━━━━━━━━━━━━━━━━━")]
public AudioClip[] songs;
[Header("━━━ AUDIO SOURCE ━━━━━━━━━━━━━━━━━━━━━━")]
public AudioSource audioSource;
private int lastIndex = -1;
// ============================================================
void Start()
{
PlayRandom();
}
void Update()
{
if (!audioSource.isPlaying)
PlayRandom();
}
// ============================================================
void PlayRandom()
{
if (songs == null || songs.Length == 0) return;
int index;
do
{
index = Random.Range(0, songs.Length);
}
while (index == lastIndex && songs.Length > 1); // aynı şarkı üst üste gelmesin
lastIndex = index;
audioSource.clip = songs[index];
audioSource.Play();
}
}