Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class GameMap : MonoBehaviour {
  5.  
  6. public GameObject[] spawnPoints;
  7. void Awake() {
  8. spawnPoints = GameObject.FindGameObjectsWithTag("Respawn");
  9. }
  10. // Use this for initialization
  11. void Start () {
  12.  
  13. }
  14.  
  15. // Update is called once per frame
  16. void Update () {
  17.  
  18. }
  19.  
  20. public Vector3 getRandomSpawnPoint(){
  21. //Debug.Log (Random.Range(0, spawnPoints.Length));
  22. Debug.Log (spawnPoints.Length);
  23. GameObject randomSpawn = spawnPoints[Random.Range(0, this.spawnPoints.Length)];
  24. //Debug.Log (randomSpawn.transform.localPosition);
  25. return randomSpawn.transform.localPosition;
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement