// Update is called once per frame void Update() { scoreTimer += Time.deltaTime; if (scoreTimer >= 3) { scoreTimer = 0; float tmpScore = data.GetScore(); if (tmpScore > 10) { data.SetScore(-10); } } if (data.GetScore() >= 100.0f) { pooping(); data.SetScore(-10); } Moving(); if (data.GetPlayerState() == playerData.PlayerState.monster) { timeCount += Time.deltaTime; if (timeCount >= 10) { timeCount -= 10.0f; TurnHuman(); } } }
// Update is called once per frame void OnGUI() { if (pd) { //get score and display it in text field of GUIText element int score = pd.GetScore(); this.gameObject.GetComponent <GUIText>().text = score.ToString(); } }
// Update is called once per frame void Update() { img.fillAmount = data.GetScore() * 0.01f; }