Skip to content
Snippets Groups Projects
Commit c692d1d9 authored by Malik Rafsanjani's avatar Malik Rafsanjani
Browse files

Merge branch 'malik/fix/shop-show-exit-quest' into 'master'

feat: show shop temporary only

See merge request !23
parents b2d874fb a8b90c30
Branches
Tags
1 merge request!23feat: show shop temporary only
...@@ -55,10 +55,24 @@ public class Temple : MonoBehaviour ...@@ -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 // Start is called before the first frame update
void Start() void Start()
{ {
Shop.SetActive(false);
} }
// Update is called once per frame // Update is called once per frame
...@@ -83,8 +97,17 @@ public class Temple : MonoBehaviour ...@@ -83,8 +97,17 @@ public class Temple : MonoBehaviour
timer.StartTimer(); timer.StartTimer();
} }
private IEnumerator ShowShop()
{
Shop.SetActive(true);
yield return new WaitForSeconds(30f);
Shop.SetActive(false);
}
private void ExitingQuest() private void ExitingQuest()
{ {
StartCoroutine(ShowShop());
var reward = questNumberEnemy.Reward; var reward = questNumberEnemy.Reward;
GameControl.control.addCurrency(reward); GameControl.control.addCurrency(reward);
timer.StopTimer(); timer.StopTimer();
......
...@@ -29,6 +29,12 @@ public class ShopCollider : MonoBehaviour ...@@ -29,6 +29,12 @@ public class ShopCollider : MonoBehaviour
} }
} }
private void OnDisable()
{
Close();
shop.SetActive(false);
}
private void OnCollisionEnter(Collision other) private void OnCollisionEnter(Collision other)
{ {
if(!temple.OnQuest && other.gameObject.name.Equals("Player")) if(!temple.OnQuest && other.gameObject.name.Equals("Player"))
...@@ -42,8 +48,13 @@ public class ShopCollider : MonoBehaviour ...@@ -42,8 +48,13 @@ public class ShopCollider : MonoBehaviour
{ {
if(other.gameObject.name.Equals("Player")) if(other.gameObject.name.Equals("Player"))
{ {
stall_state = false; Close();
Hud.CloseMessagePanel();
} }
} }
private void Close()
{
stall_state = false;
Hud.CloseMessagePanel();
}
} }
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment