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

public class RotateCoin : MonoBehaviour {

    public static RotateCoin instance;

    private float rotateSpeed = 15f;

    public int countCoin;

	void Start () {
        countCoin = 1;
	}
	
	void Update () {
        transform.Rotate(0f, rotateSpeed, 0f);
	}

    void OnTriggerEnter2D(Collider2D collision) {
        if (collision.tag == "Player") {
            Destroy(gameObject);
            ScoreCount.instance.CountScore(countCoin);
        }
    }
}
