Introduced new animations, prefabs, scripts, and textures to implement a win condition in the game. Updated InventoryScript to trigger the win state when the required coin count is reached. Added supporting assets such as win animations, GUI elements, and sound effects.
28 lines
443 B
C#
28 lines
443 B
C#
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
public class WinScript : MonoBehaviour {
|
|
|
|
public GUITexture winGUI;
|
|
public AudioClip winSound;
|
|
public GUITexture fader;
|
|
void Start () {
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update () {
|
|
|
|
}
|
|
|
|
IEnumerator gameOver()
|
|
{
|
|
AudioSource.PlayClipAtPoint(winSound, transform.position, 0.1f);
|
|
Instantiate(winGUI);
|
|
|
|
yield return new WaitForSeconds(5.0f);
|
|
|
|
Instantiate(fader);
|
|
}
|
|
}
|