You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

48 lines
922 B

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;
}
}
}