public void keyed() //Called when the block's note is played. { //For now, just remove it col.enabled = false; AudioManager.Instance.PlayPuzzleSound("SoftGlassBreak"); matManager.Dissolve(); /* * if (pos == 1) * { * transform.GetChild(0).gameObject.GetComponent<SpriteGlowEffect>().OutlineWidth = 0; * transform.position = new Vector2(transform.position.x + xTransform, transform.position.y + yTransform); * noteSprite.sprite = note2; * activeCode = code2; * AudioManager.Instance.PlayPuzzleSound("SoftGlassBreak"); * pos = 2; * } * else if (pos == 2) * { * transform.GetChild(0).gameObject.GetComponent<SpriteGlowEffect>().OutlineWidth = 1; * transform.position = new Vector2(transform.position.x + (xTransform * -1f), transform.position.y + (yTransform * -1f )); * noteSprite.sprite = note1; * activeCode = code1; * AudioManager.Instance.PlayPuzzleSound("SoftGlassBreak"); * pos = 1; * }*/ }
public void opened() //Called when the correct note is pressed. Opens the active lock and makes the next one active. { if (!open) { if (active == 1) { sr1.color = new Color(1, 1, 1, 0.3f); //lock1.transform.position = new Vector2(lock1.transform.position.x, lock1.transform.position.y + moveAmount); active = 2; activeCode = code2; AudioManager.Instance.PlayPuzzleSound("SoftGlassBreak"); } else if (active == 2) { sr2.color = new Color(1, 1, 1, 0.3f); //lock2.transform.position = new Vector2(lock2.transform.position.x, lock2.transform.position.y + moveAmount); active = 3; activeCode = code3; AudioManager.Instance.PlayPuzzleSound("SoftGlassBreak"); } else if (active == 3) //If all locks are open, keep the gate open { mat1.Dissolve(); mat2.Dissolve(); mat3.Dissolve(); col1.enabled = false; col2.enabled = false; col3.enabled = false; //lock3.transform.position = new Vector2(lock3.transform.position.x, lock3.transform.position.y + moveAmount); open = true; AudioManager.Instance.PlayPuzzleSound("SoftGlassBreak"); } } }