From 8f48369e15c7091fc2dbad072002f1c16cc68d87 Mon Sep 17 00:00:00 2001
From: Erno Lokkila <eolokk@utu.fi>
Date: Sun, 3 Mar 2019 23:55:06 +0200
Subject: [PATCH] added music for house upgrades

---
 Assets/Scripts/City/City.cs             | 9 +++++++++
 Assets/Scripts/EventSystem/EventType.cs | 1 +
 2 files changed, 10 insertions(+)

diff --git a/Assets/Scripts/City/City.cs b/Assets/Scripts/City/City.cs
index 3f62dd1..e173e13 100644
--- a/Assets/Scripts/City/City.cs
+++ b/Assets/Scripts/City/City.cs
@@ -111,6 +111,15 @@ public class City : MonoBehaviour
         spriteIndex = Math.Min(spriteIndex+1, sprites.Length-1);
         this.population += v;
         gameObject.GetComponent<SpriteRenderer>().sprite = sprites[spriteIndex];
+
+        if(spriteIndex == 1)
+            EventSystem.EventHappened(EventType.CityBig);
+        else if (spriteIndex == 2)
+            EventSystem.EventHappened(EventType.HuntingSmall);
+        else if (spriteIndex == 3)
+            EventSystem.EventHappened(EventType.HuntingBig);
+        else if (spriteIndex == 4)
+            EventSystem.EventHappened(EventType.Ultimate);
     }
 
     private void Update()
diff --git a/Assets/Scripts/EventSystem/EventType.cs b/Assets/Scripts/EventSystem/EventType.cs
index 5802558..783e6ff 100644
--- a/Assets/Scripts/EventSystem/EventType.cs
+++ b/Assets/Scripts/EventSystem/EventType.cs
@@ -12,6 +12,7 @@ public enum EventType
     HuntingSmall,
     HuntingBig,
     WinMusic,
+    Ultimate,
     //effects
     WoodChopped, 
     StoneCut, 
-- 
GitLab