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

public class StarScore : MonoBehaviour {

    public int scoreAmount = 1;

    void OnTriggerEnter2D(Collider2D other) {

        if (other.gameObject.tag == "Player") {
            ManagerReferences refs =
                GameObject.Find("Menager").GetComponent<ManagerReferences>();
            refs.IncreaseScore(scoreAmount);
            Destroy(gameObject);
        }

    }

	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
		
	}
}
