Newer
Older
HardPoint-Project-Abertay-University-Unity3D / Assets / Scripts / EndTutorial.cs
@Rackday Rackday on 18 Aug 483 bytes Project Added
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EndTutorial : MonoBehaviour
{
    public static EndTutorial instance;

    public int numObjectsDestroyed = 0;
    public GameObject objectToDestroy;

    private void Awake()
    {
        instance = this;
    }

    public void ObjectDestroyed()
    {
        numObjectsDestroyed++;

        if (numObjectsDestroyed >= 6)
        {
            Destroy(objectToDestroy);
        }
    }
}