Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5.  
  6. public class GameManager : MonoBehaviour {
  7.  
  8. [Header("Prefabs")]
  9. public GameObject pref_Zombie;
  10.  
  11. [Header("Canvas")]
  12. public Text txt_Xp;
  13.  
  14. [Header("Stats")]
  15. public int Xp;
  16.  
  17. public static GameManager Instance;
  18.  
  19. void Start () {
  20. Instance = this;
  21. }
  22.  
  23. private void Update()
  24. {
  25. txt_Xp.text = Xp.ToString();
  26. }
  27.  
  28. public void SpawnZombie()
  29. {
  30. Instantiate(pref_Zombie, new Vector3(Random.Range(-4.2f, 3.7f), 0, Random.Range(-4.2f, 3.7f)), Quaternion.identity);
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement