Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class GameManager : MonoBehaviour
- {
- private int score = 0;
- private int lives = 10;
- void Start()
- {
- }
- void Update()
- {
- }
- //shows game over when lives = 0
- public void AddLives(int value)
- {
- lives += value;
- if (lives <= 0)
- {
- Debug.Log("Game Over");
- lives = 0;
- }
- Debug.Log("Lives =" + lives);
- }
- //adds score when player destroys animals
- public void AddScore(int value)
- {
- score += value;
- Debug.Log("Score =" + score);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement