private void Update() { var ll = LevelTrack.indexToString(Application.loadedLevel); if (ll.Equals("StartPage") || ll.Equals("Phone") || ll.Equals("HomeTV") || ll.Equals("Credits") || ll.Equals("Instructions_1") || ll.Equals("Instructions_2") || ll.Equals("Instructions_3") || ll.Equals("Instructions_4") || ll.Equals("Instructions_5") || ll.Equals("Computer") || ll.Equals("4D") || ll.Equals("CompleteQuest") || ll.Equals("FailQuest") || ll.Equals("ExitQuest") || ll.Equals("EndGame") || ll.Equals("Phone") || ll.Equals("HomeTV") || ll.Equals("Menu") || ll.Equals("Instructions_6") || ll.Equals("Instructions_7") || ll.Equals("Instructions_8")) { hide = true; } else { hide = false; } if (gameObject.tag == "Text") { GetComponent <GUIText>().text = "Money: $" + amt + "\nDebt: $" + GameProperties.debt; if (hide) { GetComponent <GUIText>().text = ""; } } if ((ll.Equals("Home") || ll.Equals("Town") || ll.Equals("Office")) && amt + TextBoxBank.getBalance() > GameProperties.debt && (!win || !Application.loadedLevelName.Equals("EndGame"))) { Debug.Log("win by money"); win = true; GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>().fade("EndGame"); } else if (amt < 0) { GameProperties.debt -= amt; amt = 0; } }
// Update is called once per frame private void Update() { if (Input.GetMouseButtonDown(0)) { if (r.Contains(Camera.main.ScreenToWorldPoint(Input.mousePosition))) { var s = LevelTrack.indexToString(Application.loadedLevel); if (s.Equals("Instructions_1")) { Application.LoadLevel("Instructions_2"); } else if (s.Equals("Instructions_2")) { Application.LoadLevel("Instructions_3"); } else if (s.Equals("Instructions_3")) { Application.LoadLevel("Instructions_4"); } else if (s.Equals("Instructions_4")) { Application.LoadLevel("Instructions_5"); } else if (s.Equals("Instructions_5")) { Application.LoadLevel("Instructions_6"); } else if (s.Equals("Instructions_6")) { Application.LoadLevel("Instructions_7"); } else if (s.Equals("Instructions_7")) { Application.LoadLevel("Instructions_8"); } else if (s.Equals("Instructions_8")) { GameObject.Find("ScreenFader").GetComponent <ScreenFader>().fade(LevelTrack.prevLevel); } else if (s.Equals("EndGame")) { GameObject.Find("WinningNumber").GetComponent <WinningNumber>().reset(); GameObject.Find("Computer").GetComponent <QuestManager>().reset(); MoneyCounter.reset(); DayCounter.reset(); TextBoxBank.reset(); GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>().fade("Menu"); } } } if (!isOver && r.Contains(Camera.main.ScreenToWorldPoint(Input.mousePosition))) { isOver = true; transform.localScale += new Vector3(0.1f, 0.1f, 0); } if (isOver && !r.Contains(Camera.main.ScreenToWorldPoint(Input.mousePosition))) { isOver = false; transform.localScale -= new Vector3(0.1f, 0.1f, 0); } }