// 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(); } } }
private void OnTriggerEnter2D(Collider2D col) { playerData col_data = col.gameObject.GetComponent <playerData>(); col_data.SetScore(5); this.gameObject.SetActive(false); GameManager.game.GetComponent <FoodSystem>().food_Unused.Enqueue(this.gameObject); }
private void OnTriggerEnter2D(Collider2D col) { // score-- playerData col_data = col.gameObject.GetComponent <playerData>(); if (col_data.GetPlayerState() == playerData.PlayerState.human) { col_data.SetScore(-1); col.gameObject.GetComponent <player>().stepPoop(); // pic } else { Destroy(gameObject); } }