Added ITask and basic connection
This commit is contained in:
42
Assets/GameManager/GameManager.cs
Normal file
42
Assets/GameManager/GameManager.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user