// Update is called once per frame void Update() { hint += Time.deltaTime; if (obj1.clicked == true && obj2.clicked == true && obj3.clicked == true) { right = true; } else { right = false; } if (CombinationPuzzle.num == 3 && right == false) { lose.Play(); StartCoroutine(reset()); CombinationPuzzle.num = 0; } else if (CombinationPuzzle.num == 3 && right == true) { anim.SetBool("won", true); won = true; victory.Play(); CombinationPuzzle.num = 4; } if (won) { timer += Time.deltaTime; } if (timer > time.length) { CrossSceneScript.insertInventory("sword"); anim.gameObject.SetActive(false); } if (hint > 20) { hintText.SetActive(true); } }
// Update is called once per frame void Update() { hint += Time.deltaTime; if (eye.activeSelf) { anim.SetBool("won", true); //Debug.Log ("hi"); } if (anim.GetBool("won")) { count += Time.deltaTime; //Debug.Log ("hi"); } if (count > time.length - 0.1f) { anim.gameObject.SetActive(false); CrossSceneScript.insertInventory("helmet"); victory.Play(); } if (hint > 20) { hintText.SetActive(true); } }
// Update is called once per frame void Update() { int i = 0; int temp; foreach (string s in inventory) { if (s == null) { temp = i; for (int j = 0; j < inventory.Length - temp; j++) { inventory [temp] = inventory [j]; } } i++; } if (CrossSceneScript.contains("jewel")) { slots [0].color = new Color(255, 255, 255, 255); slots [0].sprite = sprites [0]; } else { slots [0].sprite = null; slots [0].color = new Color(255, 255, 255, 0); } if (CrossSceneScript.contains("sandals")) { slots [1].color = new Color(255, 255, 255, 255); slots [1].sprite = sprites [1]; } else { slots [1].sprite = null; slots [1].color = new Color(255, 255, 255, 0); } if (CrossSceneScript.contains("helmet")) { slots [2].color = new Color(255, 255, 255, 255); slots [2].sprite = sprites [2]; } else { slots [2].sprite = null; slots [2].color = new Color(255, 255, 255, 0); } if (CrossSceneScript.contains("sword")) { slots [3].color = new Color(255, 255, 255, 255); slots [3].sprite = sprites [3]; } else { slots [3].sprite = null; slots [3].color = new Color(255, 255, 255, 0); } if (Input.GetKeyDown(KeyCode.Space)) { Application.LoadLevel("Starting room2.0"); } else if (Input.GetKeyDown(KeyCode.Keypad1)) { Application.LoadLevel("Maze1.0"); } else if (Input.GetKeyDown(KeyCode.Keypad2)) { Application.LoadLevel("Rotation1.0"); } else if (Input.GetKeyDown(KeyCode.Keypad3)) { Application.LoadLevel("Combination1.0"); } else if (Input.GetKeyDown(KeyCode.Keypad4)) { Application.LoadLevel("OwlCloseup"); } }
// Use this for initialization void Start() { CrossSceneScript.insertInventory("jewel"); }