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

public class MarkController : MonoBehaviour {



    
    public Sprite WhiteBall;
    public Sprite BlueBall;
    public Sprite RedBall;
    //public Text countText;
    private SpriteRenderer markSpriteRenderer;
    public bool markReached;

    private int Count;

	// Use this for initialization
	void Start () {
        markSpriteRenderer = GetComponent<SpriteRenderer> ();
        // Count = 0;
        //GameMaster.gm.setCountText();
        

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

    void OnTriggerEnter2D(Collider2D other) {
        if (other.tag == "Player") {
            print("hit");

            if (markReached)
                return;

            markSpriteRenderer.sprite = BlueBall;
            markReached = true;
            GameMaster.gm.setCountText();
            //setCountText();
        }
    }


    //void setCountText ()
    //{
     //   countText.text = "Count: " + Count;
    //}
}
