using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using UnityEngine;
|
|
using Networking.Server;
|
|
|
|
|
|
public class GameManager : MonoBehaviour
|
|
{
|
|
#region Inspector Field
|
|
|
|
[Header("References")]
|
|
[SerializeField]
|
|
[Tooltip("Prefab of character for players to play")]
|
|
private Character characterPrefab;
|
|
|
|
[SerializeField]
|
|
private ConnectionHandler ClientList;
|
|
#endregion Inspector Field
|
|
|
|
|
|
#region Private Variables
|
|
private Block[] SpawnBlocks;
|
|
#endregion Private Variables
|
|
|
|
public void Start()
|
|
{
|
|
SpawnBlocks = FindObjectsOfType<Block>().Where(p => p.isSpawnable).ToArray();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void SpawnCharacters()
|
|
{
|
|
foreach(ClientData client in ClientList)
|
|
{
|
|
Character newChar = Instantiate(characterPrefab);
|
|
newChar.transform.position = SpawnBlocks[0].VisualPosition;
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|