diff --git a/Assets/Scripts/Quest/Temple/Temple.cs b/Assets/Scripts/Quest/Temple/Temple.cs index b43992e80ea662ad81d0a61058fe0e8f82a913b5..8321b7708df7178e76d88c17fd9e512d91a57064 100644 --- a/Assets/Scripts/Quest/Temple/Temple.cs +++ b/Assets/Scripts/Quest/Temple/Temple.cs @@ -55,10 +55,24 @@ public class Temple : MonoBehaviour } } + private GameObject shop; + public GameObject Shop + { + get + { + if (shop == null) + { + shop = GameObject.Find("Environment/stall_001"); + } + + return shop; + } + } + // Start is called before the first frame update void Start() { - + Shop.SetActive(false); } // Update is called once per frame @@ -83,8 +97,17 @@ public class Temple : MonoBehaviour timer.StartTimer(); } + private IEnumerator ShowShop() + { + Shop.SetActive(true); + yield return new WaitForSeconds(30f); + Shop.SetActive(false); + } + private void ExitingQuest() { + StartCoroutine(ShowShop()); + var reward = questNumberEnemy.Reward; GameControl.control.addCurrency(reward); timer.StopTimer(); diff --git a/Assets/Scripts/Shops/ShopCollider.cs b/Assets/Scripts/Shops/ShopCollider.cs index 2f68f3f57399152f2f4240a46e678dee5243a115..fdd22b809ed562a68e2a2a3dea6a4e763f7d7ba1 100644 --- a/Assets/Scripts/Shops/ShopCollider.cs +++ b/Assets/Scripts/Shops/ShopCollider.cs @@ -29,6 +29,12 @@ public class ShopCollider : MonoBehaviour } } + private void OnDisable() + { + Close(); + shop.SetActive(false); + } + private void OnCollisionEnter(Collision other) { if(!temple.OnQuest && other.gameObject.name.Equals("Player")) @@ -42,8 +48,13 @@ public class ShopCollider : MonoBehaviour { if(other.gameObject.name.Equals("Player")) { - stall_state = false; - Hud.CloseMessagePanel(); + Close(); } } + + private void Close() + { + stall_state = false; + Hud.CloseMessagePanel(); + } }