// Use this for initialization void Awake() { sr = GetComponent <SpriteRenderer>(); ec = GameObject.Find("Grid").GetComponent <EventControl>(); //Random gerneration of mine mine = Random.value < 0.15; x = (int)transform.position.x; y = (int)transform.position.y; GridControl.elements[x, y] = this; if (mine) { ec.MineCountUp(); } }