// Use this for initialization void Start() { shadow = Instantiate(prefab); sm = FindObjectOfType <Snap2>(); gs = FindObjectOfType <GridSize>(); g = FindObjectOfType <GridScript>(); }
void OnTriggerEnter2D(Collider2D col) { Snap2 sm = transform.parent.GetComponent <Snap2>(); if (sm.lockTetramino && sm.canMove && sm.canFall) { if (col.tag == "Player") { hit++; if (hit == 1) { FindObjectOfType <T_LevelController>().gotHit = true; } } } }