using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CoinPuckup : MonoBehaviour {
public GameObject coin;
public static int coinsCollected;
public GameObject Portal_04;
private bool SetActive;
void OnTriggerEnter()
{
//Destroy(coin);
coin.SetActive(false);
coinsCollected = (coinsCollected + 1);
}
void Start()
{
if (coinsCollected == 0)
{
Portal_04.SetActive(false);
}
if (coinsCollected == 3)
{
Portal_04.SetActive(true);
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EndGame : MonoBehaviour
{
public static int coinsCollected;
void OnTriggerEnter(Collider Player)
{
if (Player.gameObject.tag == "Portal_04" & coinsCollected == 3)
{
Application.Quit();
}
}
}