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

feat: show shop temporary only

parent 2eb1d6eb
1 merge request!23feat: show shop temporary only
......@@ -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();
......
......@@ -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();
}
}
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