﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class scoreScript : MonoBehaviour
{
    GameObject GameController;
    public int scoreValue;
    private void OnDestroy()
    {
        if (GameController != null)
        {
            GameController.GetComponent<ScorecounterScript>().updateScore(scoreValue);
        }
    }
    // Start is called before the first frame update
    void Start()
    {
        GameController = GameObject.Find("GameController");

    }

    // Update is called once per frame
    void Update()
    {
       
    }
}
