private void OnTriggerEnter2D(Collider2D collision) { sk.SendMessage("UnlockYourself"); sr.color = new Color(1.0f, 0, 0, 1.0f); smo.disableSpeaker(); }
void OnCollisionStay2D(Collision2D other) { gameobjectToInform.SendMessage("OnKeyTouched"); gameObject.GetComponent <Renderer>().material.color = Color.green; if (SceneManager.GetActiveScene().name.Equals("Level_06_RC", System.StringComparison.OrdinalIgnoreCase)) { smo.disableSpeaker(); } //Debug.Log ("key touched"); //gameObject.transform.position = new Vector3 (gameObject.transform.position.x, keyDownLimit.position.y, gameObject.transform.position.z); }