// Use this for initialization void Start() { gridSpawner = GameObject.FindGameObjectWithTag("Spawner").GetComponent <SpawnGrid>(); grid = gridSpawner.grid; fuelBehaviour = GameObject.FindGameObjectWithTag("FuelBar").GetComponent <FuelBehaviour>(); points = fuelBehaviour.dollars; }
// Start is called before the first frame update void Start() { startingMoveSpeed = moveSpeed; spawnGrid = GetComponent <SpawnGrid>(); SetupInvadersMoveCommand(); }
void SpawnPlayer() { SpawnGrid randomSpawn = spawnGrid[Random.Range(0, spawnGrid.Count)]; Vector3 spawnPoint = new Vector3(randomSpawn.x, randomSpawn.y); PhotonNetwork.Instantiate(playerPrefab.name, spawnPoint, Quaternion.identity, 0); }
public Vector3 FreeSpawnLocation() { SpawnGrid randomSpawn = spawnGrid[Random.Range(0, spawnGrid.Count)]; Vector3 spawnPoint = new Vector3(randomSpawn.x, randomSpawn.y); while (!CheckSpawnIsFree(spawnPoint)) { randomSpawn = spawnGrid[Random.Range(0, spawnGrid.Count)]; spawnPoint = new Vector3(randomSpawn.x, randomSpawn.y); } return(spawnPoint); }
// Use this for initialization void Start() { fuelBar = GameObject.FindGameObjectWithTag("FuelBar").GetComponent <FuelBehaviour>(); grid = GameObject.FindGameObjectWithTag("Spawner").GetComponent <SpawnGrid>(); refuel = GameObject.FindGameObjectWithTag("Refuel"); }