Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class GameManager : MonoBehaviour {
- [Header("Prefabs")]
- public GameObject pref_Zombie;
- [Header("Canvas")]
- public Text txt_Xp;
- [Header("Stats")]
- public int Xp;
- public static GameManager Instance;
- void Start () {
- Instance = this;
- }
- private void Update()
- {
- txt_Xp.text = Xp.ToString();
- }
- public void SpawnZombie()
- {
- Instantiate(pref_Zombie, new Vector3(Random.Range(-4.2f, 3.7f), 0, Random.Range(-4.2f, 3.7f)), Quaternion.identity);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement