private void Awake() { if (s_thisInstance == null) { s_thisInstance = this; } else { Destroy(gameObject); } //Get highscore list m_lists = gameObject.transform.Find("LeftPanel").transform.Find("HighscoreList (1)").transform.Find("Lists").gameObject; m_names = m_lists.transform.Find("Names").gameObject.GetComponentsInChildren <Text>(true); m_scores = m_lists.transform.Find("Scores").gameObject.GetComponentsInChildren <Text>(true); m_times = m_lists.transform.Find("Times").gameObject.GetComponentsInChildren <Text>(true); m_inputField = gameObject.GetComponentInChildren <InputField>(); m_inputField.contentType = InputField.ContentType.Alphanumeric; m_inputField.onEndEdit.AddListener(delegate { SaveName(); }); m_playerScoreText = gameObject.transform.Find("RightPanel").transform.Find("PlayerScore").GetComponentInChildren <Text>(true); m_buttons = gameObject.transform.Find("RightPanel").GetComponentsInChildren <Button>(true); foreach (var item in m_names) { item.text = "-"; } foreach (var item in m_scores) { item.text = "-"; } foreach (var item in m_times) { item.text = "-"; } foreach (var item in m_buttons) { item.gameObject.SetActive(false); } }
private void Start() { m_highscoreListScreen = HighscoreListScreen.s_thisInstance; moneyLost = 0; highscorePoints = 0; m_startMoney = 40000; currentMoney = m_startMoney; CurrentMoney = m_startMoney; run = false; GeneratedMoney = 0; DeductedMoney = 0; s_scoreDisplay = FindObjectOfType <ScoreDisplay>(); if (s_scoreDisplay != null) { s_scoreDisplay.SetScore(CurrentMoney, m_moneyChangeLastFrame); } }