private void OnTriggerStay2D(Collider2D otro) { if (otro.gameObject.GetComponent <Translucido>() != null) { Translucido objTrans = otro.gameObject.GetComponent <Translucido>(); thisSprite.sortingOrder = objTrans.IsTranslucent ? initialOrder : objTrans.HigherOrderInLayer + 1; thisSprite.color = objTrans.IsTranslucent ? initialColor : shadowColor; } }
void OnTriggerEnter2D(Collider2D otro) { if (otro.gameObject.GetComponent <Translucido>() != null) { Translucido objTrans = otro.gameObject.GetComponent <Translucido>(); thisSprite.sortingOrder = objTrans.IsTranslucent ? initialOrder : objTrans.HigherOrderInLayer + 1; thisSprite.color = objTrans.IsTranslucent ? initialColor : shadowColor; } if (otro.gameObject.name == "Destructor") { Destroy(this.gameObject); //StartCoroutine (destruye ()); } if (otro.gameObject.name == "FinDeNivel") { //Girar (); } }