43 lines
1.3 KiB
C#
43 lines
1.3 KiB
C#
using UnityEngine;
|
|
using GeoSus.Client;
|
|
using Subsystems;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
/*
|
|
GameManager - hlavní tøida pro správu hry
|
|
GameManager_Network - subsystém pro správu komunikace se serverem
|
|
GameManager_Game - subsystém pro správu logiky hry (sabotáže, tasky, atd.)
|
|
GameManager_Map - subsystém pro správu mapy a prostøedí
|
|
GameManager_Input - subsystém pro správu vstupu od hráèe
|
|
GameManager_UI - subsystém pro správu uživatelského rozhraní
|
|
GamaManager_Stats - subsystém pro správu statistik pro server
|
|
*/
|
|
public class GameManager : MonoBehaviour
|
|
{
|
|
protected GameClient gameClient;
|
|
protected GameManager_Network networkSubsystem;
|
|
public string displayName;
|
|
|
|
void Start()
|
|
{
|
|
DontDestroyOnLoad(this);
|
|
if (displayName == null || displayName == "")
|
|
{
|
|
displayName = "Player_" + Random.Range(1000, 9999).ToString();
|
|
}
|
|
gameClient = new GameClient(GenerateUUID(), displayName);
|
|
networkSubsystem = new GameManager_Network(gameClient);
|
|
networkSubsystem.checkState();
|
|
}
|
|
|
|
|
|
protected string GenerateUUID()
|
|
{
|
|
string UUID = System.Guid.NewGuid().ToString();
|
|
Debug.Log(UUID);
|
|
return UUID;
|
|
}
|
|
}
|