Zabiju je

This commit is contained in:
2026-04-26 13:30:33 +02:00
parent 208696487e
commit 700e6bfbfc
143 changed files with 11027 additions and 1298 deletions

View File

@@ -293,7 +293,35 @@ public class GameClient : IDisposable
{
LobbyId = r.LobbyId;
JoinCode = r.JoinCode;
CurrentLobbyState = r.LobbyState;
// Ensure we always have a valid lobby state with the creator as owner
if (r.LobbyState != null)
{
CurrentLobbyState = r.LobbyState;
if (string.IsNullOrEmpty(CurrentLobbyState.OwnerId))
CurrentLobbyState.OwnerId = ClientUuid;
}
else
{
CurrentLobbyState = new LobbyState
{
LobbyId = r.LobbyId ?? "",
JoinCode = r.JoinCode ?? "",
OwnerId = ClientUuid
};
}
// Make sure creator appears in the player list
if (CurrentLobbyState.Players == null)
CurrentLobbyState.Players = new System.Collections.Generic.List<PlayerInfo>();
if (!CurrentLobbyState.Players.Any(p => p.ClientUuid == ClientUuid))
{
CurrentLobbyState.Players.Insert(0, new PlayerInfo
{
ClientUuid = ClientUuid,
DisplayName = DisplayName,
IsOwner = true,
State = PlayerState.Alive
});
}
}
break;
@@ -303,6 +331,22 @@ public class GameClient : IDisposable
LobbyId = r.LobbyId;
CurrentLobbyState = r.LobbyState;
JoinCode = r.LobbyState?.JoinCode;
// Ensure self is in the player list
if (CurrentLobbyState != null)
{
if (CurrentLobbyState.Players == null)
CurrentLobbyState.Players = new System.Collections.Generic.List<PlayerInfo>();
if (!CurrentLobbyState.Players.Any(p => p.ClientUuid == ClientUuid))
{
CurrentLobbyState.Players.Add(new PlayerInfo
{
ClientUuid = ClientUuid,
DisplayName = DisplayName,
IsOwner = CurrentLobbyState.OwnerId == ClientUuid,
State = PlayerState.Alive
});
}
}
}
break;
@@ -344,7 +388,6 @@ public class GameClient : IDisposable
var joinedPayload = evt.GetPayload<PlayerJoinedPayload>();
if (joinedPayload != null && CurrentLobbyState?.Players != null)
{
// Check if player already exists
bool exists = CurrentLobbyState.Players.Any(p => p.ClientUuid == joinedPayload.ClientUuid);
if (!exists)
{
@@ -352,7 +395,7 @@ public class GameClient : IDisposable
{
ClientUuid = joinedPayload.ClientUuid,
DisplayName = joinedPayload.DisplayName,
IsOwner = false,
IsOwner = joinedPayload.ClientUuid == CurrentLobbyState.OwnerId,
IsReady = false,
State = PlayerState.Alive
});
@@ -491,6 +534,7 @@ public class GameClient : IDisposable
Send(new LeaveLobby());
LobbyId = null;
JoinCode = null;
CurrentLobbyState = null;
}
public void StartGame()

View File

@@ -4,43 +4,53 @@ using Subsystems;
using System.Collections;
using System;
using TMPro;
/*
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
*/
using UnityEngine.SceneManagement;
public class GameManager : MonoBehaviour
{
[Header("Subsystems")]
protected GameManager_Network networkSubsystem;
protected GameManager_UI uiSubsystem;
protected GameManager_Map mapSubsystem;
protected GameManager_Input inputSubsystem;
// Singleton
public static GameManager Instance { get; private set; }
protected GameClient gameClient;
[Header("Subsystems")]
public GameManager_Network networkSubsystem;
public GameManager_UI uiSubsystem;
public GameManager_Map mapSubsystem;
public GameManager_Input inputSubsystem;
public GameManager_Tasks taskSubsystem;
public GameClient gameClient;
[Header("Player Info")]
public string displayName;
[Header("UI Elements")]
public Canvas JoinCreateLobby;
public Canvas InLobby;
public Canvas LoadingScreen;
public Canvas GameScreen;
[Header("Scene Management")]
[SerializeField] public string firstMenuScene = "main menu asi idk lol";
[Header("UI Elements (Client.unity)")]
// Canvas names in Client.unity — found at runtime in OnSceneLoaded
private const string CanvasNameJoinCreate = "LobbySelector";
private const string CanvasNameInLobby = "InLobby";
private const string CanvasNameLoading = "LoadingScreen";
private const string CanvasNameGame = "InGame";
[Header("Map")]
public GameObject MapCenterPoint;
// MapCenterPoint and Player are in Client.unity — wired at runtime in OnSceneLoaded.
// buildingSettings/pathwaySettings/areaSettings must be assigned in SampleScene Inspector.
public BuildingSettings buildingSettings;
public PathwaySettings pathwaySettings;
public AreaSettings areaSettings;
[Header("GPS")]
public GameObject Player;
[Header("Lobby Settings")]
public double pendingRadius = 500;
public int pendingImpostorCount = 1;
public int pendingTaskCount = 5;
[Header("Task Minigames (round-robin)")]
[SerializeField] public string[] minigameScenes = {
"MiniGame-Kabely",
"MiniGame-InsertKeys",
"MiniGame-FlappyBird",
"MiniGame-ThrowInHole"
};
[Header("Debug")]
public bool testMode = false;
@@ -49,100 +59,307 @@ public class GameManager : MonoBehaviour
private GameManager_Network _secondNetwork;
private GameManager_Network _thirdNetwork;
void Awake()
{
if (Instance != null && Instance != this)
{
Destroy(gameObject);
return;
}
Instance = this;
DontDestroyOnLoad(gameObject);
}
void Start()
{
DontDestroyOnLoad(this);
if (displayName == null || displayName == "")
{
displayName = GenerateUsername();
}
if (string.IsNullOrEmpty(displayName))
displayName = PlayerPrefs.GetString("PlayerName", GenerateUsername());
gameClient = new GameClient(GenerateUUID(), displayName);
networkSubsystem = new GameManager_Network(gameClient, this);
mapSubsystem = new GameManager_Map(gameClient, null, buildingSettings, pathwaySettings, areaSettings);
uiSubsystem = new GameManager_UI(gameClient);
inputSubsystem = new GameManager_Input(gameClient, null, testMode);
taskSubsystem = new GameManager_Tasks(gameClient, minigameScenes, this);
if (testMode)
{
_secondClient = new GameClient(GenerateUUID(), GenerateUsername());
_secondNetwork = new GameManager_Network(_secondClient);
_secondNetwork = new GameManager_Network(_secondClient, null);
_thirdClient = new GameClient(GenerateUUID(), GenerateUsername());
_thirdNetwork = new GameManager_Network(_thirdClient);
_secondNetwork.OpenConection();
_thirdNetwork.OpenConection();
_thirdNetwork = new GameManager_Network(_thirdClient, null);
_secondNetwork.OpenConnection();
_thirdNetwork.OpenConnection();
}
gameClient = new GameClient(GenerateUUID(), displayName);
uiSubsystem = new GameManager_UI(gameClient, JoinCreateLobby, InLobby, LoadingScreen, GameScreen);
networkSubsystem = new GameManager_Network(gameClient);
mapSubsystem = new GameManager_Map(gameClient, MapCenterPoint, buildingSettings, pathwaySettings, areaSettings);
inputSubsystem = new GameManager_Input(gameClient, Player, testMode);
networkSubsystem.OpenConection();
networkSubsystem.OpenConnection();
// Load main menu after GameManager is ready
if (!string.IsNullOrEmpty(firstMenuScene))
SceneManager.LoadScene(firstMenuScene, LoadSceneMode.Single);
}
private void Update()
{
if (gameClient.CurrentLobbyState != null)
{
uiSubsystem.UpdateLobbyUI();
}
try
{
if (gameClient.CurrentLobbyState.MapDataReady)
{
mapSubsystem.BuildMap();
gameClient.CurrentLobbyState.MapDataReady = false;
}
}
catch (NullReferenceException ex) { }
inputSubsystem.positionCheck();
}
protected string GenerateUUID()
{
string UUID = System.Guid.NewGuid().ToString();
Debug.Log(UUID);
return UUID;
}
protected string GenerateUsername()
{
string Username = UnityEngine.Random.Range(0,10).ToString() + UnityEngine.Random.Range(0, 10).ToString() + UnityEngine.Random.Range(0, 10).ToString() + UnityEngine.Random.Range(0, 10).ToString();
Debug.Log(Username);
return Username;
}
public void CreateLobbyButton()
{
networkSubsystem.CrateLobby(50.7727264, 15.0719876);
// Tick the SDK dispatcher so callbacks fire on main thread
gameClient?.Update();
if (testMode)
{
StartCoroutine(ConnectTestClients());
_secondClient?.Update();
_thirdClient?.Update();
}
if (gameClient?.CurrentLobbyState != null)
{
uiSubsystem?.UpdateLobbyUI();
taskSubsystem?.UpdateProximity();
}
if (gameClient?.MyRole == PlayerRole.Impostor)
UpdateKillCooldown();
inputSubsystem?.positionCheck();
}
void OnEnable()
{
SceneManager.sceneLoaded += OnSceneLoaded;
}
void OnDisable()
{
SceneManager.sceneLoaded -= OnSceneLoaded;
}
/// <summary>
/// After Client.unity loads, re-bind all canvas/HUD references because
/// those GameObjects don't exist in the Art menu scenes.
/// </summary>
private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
if (scene.name == "Client")
{
var roots = scene.GetRootGameObjects();
// Find a root or deep GameObject by name in the loaded scene
GameObject FindGO(string n) {
foreach (var go in roots) {
if (go.name == n) return go;
var found = go.transform.Find(n);
if (found != null) return found.gameObject;
}
return null;
}
Canvas FindCanvas(string n) {
var go = FindGO(n);
return go != null ? go.GetComponent<Canvas>() : null;
}
// ── Build HUD BEFORE BindClientScene so FindTMP/Find can locate new elements ──
var inGameGO = FindGO("InGame");
if (inGameGO != null)
{
var builder = inGameGO.GetComponent<InGameHUDBuilder>()
?? inGameGO.AddComponent<InGameHUDBuilder>();
builder.BuildNow();
}
// ── Wire canvases (after HUD is built) ──
uiSubsystem?.BindClientScene(
FindCanvas(CanvasNameJoinCreate),
FindCanvas(CanvasNameInLobby),
FindCanvas(CanvasNameLoading),
FindCanvas(CanvasNameGame));
// ── Wire map center point and player capsule ──
var mapCenter = FindGO("MapCenterPoint");
var player = FindGO("Capsule");
mapSubsystem?.SetMapCenterPoint(mapCenter);
inputSubsystem?.SetPlayerObject(player);
// ── Attach camera controller to Main Camera ──
var mainCamGO = FindGO("Main Camera");
if (mainCamGO != null)
{
var camCtrl = mainCamGO.GetComponent<MapCameraController>()
?? mainCamGO.AddComponent<MapCameraController>();
camCtrl.SetTarget(player);
}
// If MapDataReady arrived before Client scene finished loading,
// this will build the map now that scene references are valid.
networkSubsystem?.OnClientSceneReady();
}
else if (scene.name == "create" || scene.name == "join loading")
{
// Lobby scene just loaded — ensure LobbyDisplayUI refreshes once
// its Start() has run and registered itself (happens before Update).
uiSubsystem?.NotifyLobbyChanged();
}
}
public void JoinLobbyButton()
// ── Kill cooldown ─────────────────────────────────────────────────────────
private float _killCooldownSeconds = 0f;
private const float KillCooldownDuration = 20f;
private void UpdateKillCooldown()
{
TMP_InputField joinCode = JoinCreateLobby.transform.Find("InputCode").GetComponent<TMP_InputField>();
if (joinCode.text != null && joinCode.text != "")
if (_killCooldownSeconds > 0)
{
networkSubsystem.JoinLobby(joinCode.text);
_killCooldownSeconds -= Time.deltaTime;
uiSubsystem?.SetKillCooldownText($"Kill: {Mathf.CeilToInt(_killCooldownSeconds)}s");
}
else
{
Debug.Log("Join code is empty!");
uiSubsystem?.SetKillCooldownText("");
}
}
/// <summary>
/// Called by the ActionButton. Routes to kill / report / emergency / use-task
/// depending on current proximity state.
/// </summary>
public void PerformAction()
{
if (uiSubsystem == null || uiSubsystem.IsPlayerDead) return;
bool isImpostor = gameClient?.MyRole == PlayerRole.Impostor;
// 1. Nearby task → USE
var nearbyTask = taskSubsystem?.NearbyTask;
if (nearbyTask != null && !isImpostor)
{
taskSubsystem.TriggerNearbyTask();
return;
}
// 2. Nearby body → REPORT
if (!uiSubsystem.IsCommsBlackout)
{
var nearbyBody = gameClient?.FindNearbyBody(5.0);
if (nearbyBody != null)
{
gameClient.ReportBody(nearbyBody.BodyId);
return;
}
// 3. Near map centre → EMERGENCY
if (gameClient?.CurrentLobbyState?.MapData != null)
{
double distToCenter = gameClient.MyPosition.DistanceTo(gameClient.CurrentLobbyState.MapData.Center);
if (distToCenter <= 5.0)
{
gameClient.CallEmergencyMeeting();
return;
}
}
}
// 4. Impostor kill
if (isImpostor && _killCooldownSeconds <= 0)
{
var targetUuid = gameClient?.FindNearbyPlayer(5.0);
if (!string.IsNullOrEmpty(targetUuid))
{
gameClient.Kill(targetUuid);
_killCooldownSeconds = KillCooldownDuration;
}
}
}
/// <summary>Called by Impostor sabotage buttons.</summary>
public void StartSabotage(int typeIndex)
{
gameClient?.Send(new GeoSus.Client.StartSabotage { SabotageType = (SabotageType)typeIndex });
}
/// <summary>Called by the meeting vote buttons. Pass null to skip.</summary>
public void CastVote(string targetUuid)
{
gameClient?.Vote(targetUuid);
}
protected string GenerateUUID()
{
return System.Guid.NewGuid().ToString();
}
protected string GenerateUsername()
{
return "Player" + UnityEngine.Random.Range(1000, 9999).ToString();
}
// Called by HostLobbyUI
public void CreateLobbyButton()
{
// Use current GPS position if available, else hardcoded fallback
double lat = 50.7727264, lon = 15.0719876;
if (inputSubsystem?.LastKnownPosition != null)
{
lat = inputSubsystem.LastKnownPosition.Value.Lat;
lon = inputSubsystem.LastKnownPosition.Value.Lon;
}
networkSubsystem.CreateLobby(lat, lon, pendingRadius, pendingImpostorCount, pendingTaskCount);
if (testMode) StartCoroutine(ConnectTestClients());
}
// Called by JoinLobbyUI with the code from the input field
public void JoinLobbyButton(string code)
{
if (!string.IsNullOrEmpty(code))
networkSubsystem.JoinLobby(code);
else
Debug.LogWarning("Join code is empty!");
}
public void LeaveLobbyButton()
{
networkSubsystem.LeaveLobby();
}
public void StartGameButton()
{
networkSubsystem.StartGame();
}
void OnApplicationQuit()
{
gameClient.Disconnect();
gameClient?.Disconnect();
_secondClient?.Disconnect();
_thirdClient?.Disconnect();
_thirdClient?.Disconnect();
}
IEnumerator ConnectTestClients()
{
yield return new WaitForSeconds(2f);
_secondNetwork.JoinLobby(gameClient.CurrentLobbyState.JoinCode);
_thirdNetwork.JoinLobby(gameClient.CurrentLobbyState.JoinCode);
IEnumerator ConnectTestClients()
{
// Wait until host lobby code exists
float wait = 0f;
while ((gameClient?.CurrentLobbyState == null || string.IsNullOrEmpty(gameClient.CurrentLobbyState.JoinCode)) && wait < 20f)
{
wait += 0.25f;
yield return new WaitForSeconds(0.25f);
}
var joinCode = gameClient?.CurrentLobbyState?.JoinCode;
if (string.IsNullOrEmpty(joinCode))
{
Debug.LogWarning("[TestMode] Could not join test clients: join code not available.");
yield break;
}
// Wait until helper clients are connected and handshake-complete
wait = 0f;
while (((_secondClient == null || !_secondClient.IsReady) || (_thirdClient == null || !_thirdClient.IsReady)) && wait < 20f)
{
wait += 0.25f;
yield return new WaitForSeconds(0.25f);
}
if (_secondClient == null || _thirdClient == null || !_secondClient.IsReady || !_thirdClient.IsReady)
{
Debug.LogWarning("[TestMode] Helper clients are not ready, skipping auto-join.");
yield break;
}
_secondNetwork?.JoinLobby(joinCode);
_thirdNetwork?.JoinLobby(joinCode);
Debug.Log($"[TestMode] Helper clients joined lobby with code {joinCode}.");
}
}

View File

@@ -50,74 +50,131 @@ namespace Subsystems
private Position _lastSentPosition;
private GameObject _player;
private bool _testMode;
private GPSState _GPSState = GPSState.Uninitialized;
private float _speed = 0.00001f;
private Position _mapCenter;
private CoroutineHost _coroutineHost = new CoroutineHost();
private CoroutineHost _coroutineHost;
private int _gpsRetryCount = 0;
private const int _maxGpsRetries = 5;
private float _lastPositionSendTime;
private const float _positionKeepAliveSeconds = 1.0f;
/// <summary>Last known GPS position (for CreateLobby centre point)</summary>
public Position? LastKnownPosition => _currentPosition.Lat != 0 || _currentPosition.Lon != 0 ? _currentPosition : (Position?)null;
public GameManager_Input(GameClient gameClient, GameObject player, bool testMode)
{
_gameClient = gameClient;
_player = player;
_testMode = testMode;
// CoroutineHost needs a MonoBehaviour on a real GameObject
var hostGO = new UnityEngine.GameObject("_CoroutineHost");
UnityEngine.Object.DontDestroyOnLoad(hostGO);
_coroutineHost = hostGO.AddComponent<CoroutineHost>();
}
/// <summary>Called from OnSceneLoaded when Client.unity loads so the
/// Player capsule (which lives in Client.unity) can be wired at runtime.</summary>
public void SetPlayerObject(GameObject player) { _player = player; }
public void positionCheck()
{
var state = _gameClient?.CurrentLobbyState;
if (state == null || state.Phase != GamePhase.Playing)
return;
try
{
if (_gameClient.CurrentLobbyState.Phase == GamePhase.Playing)
if (_testMode)
{
if (_testMode)
if (_currentPosition == new Position(0, 0))
{
if (state.MapData == null)
return;
if (_currentPosition == null || _currentPosition == new Position(0, 0))
{
//Init blok
_currentPosition = _gameClient.CurrentLobbyState.MapData.Center;
_mapCenter = _gameClient.CurrentLobbyState.MapData.Center;
_lastSentPosition = _currentPosition;
}
//Init blok
_currentPosition = state.MapData.Center;
_mapCenter = state.MapData.Center;
_lastSentPosition = _currentPosition;
}
TestPlayerPosition();
TestPlayerPosition();
}
else
{
if (_GPSState == GPSState.Uninitialized)
{
_coroutineHost.StartCoroutine(InitiallizeGPS());
return;
}
else if (_GPSState == GPSState.Initializing)
{
return;
}
else if (_GPSState == GPSState.Running)
{
EnsureMapCenter();
TrySendCurrentPosition();
}
else
{
if (_GPSState == GPSState.Uninitialized)
Debug.Log("GPS failed, trying again...");
if (_gpsRetryCount < _maxGpsRetries)
{
_coroutineHost.StartCoroutine(InitiallizeGPS());
return;
}
else if (_GPSState == GPSState.Initializing)
{
return;
}
else if (_GPSState == GPSState.Running)
{
try
{
if (_currentPosition != _lastSentPosition)
{
_gameClient.UpdatePosition(_currentPosition);
_lastSentPosition = _currentPosition;
_player.transform.position = _currentPosition.ToLocalVector3(_mapCenter);
_player.transform.rotation = Quaternion.Euler(0, (float)CalculateHeading(_lastSentPosition.ToLocalVector3(_mapCenter), _currentPosition.ToLocalVector3(_mapCenter)), 0);
}
}
catch (Exception ex)
{
Debug.Log(ex);
}
_gpsRetryCount++;
_GPSState = GPSState.Uninitialized;
}
else
{
Debug.Log("GPS failed, trying again...");)
_GPSState = GPSState.Uninitialized;
Debug.LogWarning("GPS unavailable after max retries. Using last known position.");
// Keep _GPSState = Failed so we stop retrying
}
}
}
}
catch (NullReferenceException ex) { Debug.Log(ex); }
catch (Exception ex)
{
Debug.LogWarning($"[Input] positionCheck failed: {ex.Message}");
}
}
private void EnsureMapCenter()
{
if (_mapCenter.Lat != 0 || _mapCenter.Lon != 0)
return;
var md = _gameClient?.CurrentLobbyState?.MapData;
if (md != null)
_mapCenter = md.Center;
}
private void TrySendCurrentPosition()
{
bool moved = _currentPosition != _lastSentPosition;
bool keepAliveDue = (Time.time - _lastPositionSendTime) >= _positionKeepAliveSeconds;
if (!moved && !keepAliveDue)
return;
var previous = _lastSentPosition;
_gameClient.UpdatePosition(_currentPosition);
_lastSentPosition = _currentPosition;
_lastPositionSendTime = Time.time;
if (_player == null || (_mapCenter.Lat == 0 && _mapCenter.Lon == 0))
return;
var localCurrent = _currentPosition.ToLocalVector3(_mapCenter);
_player.transform.position = localCurrent;
if (previous.Lat == 0 && previous.Lon == 0)
return;
var heading = CalculateHeading(previous.ToLocalVector3(_mapCenter), localCurrent);
if (heading.HasValue)
_player.transform.rotation = Quaternion.Euler(0, (float)heading.Value, 0);
}
private void TestPlayerPosition()
{
double x = Input.GetAxis("Horizontal");
@@ -136,11 +193,7 @@ namespace Subsystems
_player.transform.position = localCurrent;
try
{
if (_currentPosition != _lastSentPosition)
{
_gameClient.UpdatePosition(_currentPosition);
_lastSentPosition = _currentPosition;
}
TrySendCurrentPosition();
}
catch
{
@@ -150,63 +203,42 @@ namespace Subsystems
}
private double? CalculateHeading(Vector3 first, Vector3 second)
{
double? heading = null;
if ((first - second).magnitude == 0)
{
return null;
}
else if (first.x == second.x && first.z < second.z)
{
return 0;
}
else if (first.x == second.x && first.z > second.z)
{
return 180;
}
else if (first.x > second.x && first.z == second.z)
{
return 270;
}
else if (first.x < second.x && first.z == second.z)
{
return 90;
}
else if (first.x < second.x && first.z < second.z)
{
heading = Math.Asin((second.z - first.z) / first.DistanceTo(second));
return (heading * 180) / Math.PI;
}
else if (first.x < second.x && first.z > second.z)
{
heading = Math.Asin((second.z - first.z) / first.DistanceTo(second));
return (heading * 180) / Math.PI + 180;
}
else if (first.x > second.x && first.z < second.z)
{
heading = Math.Asin((second.z - first.z) / first.DistanceTo(second));
return (heading * 180) / Math.PI - 90;
}
else if (first.x > second.x && first.z > second.z)
{
heading = Math.Asin((second.z - first.z) / first.DistanceTo(second));
return (heading * 180) / Math.PI - 90;
}
else
{
return heading;
}
if ((first - second).magnitude < 0.0001f) return null;
float dx = second.x - first.x;
float dz = second.z - first.z;
float heading = Mathf.Atan2(dx, dz) * Mathf.Rad2Deg;
if (heading < 0) heading += 360f;
return heading;
}
IEnumerator InitiallizeGPS()
{
_GPSState = GPSState.Initializing;
#if UNITY_ANDROID
// Request fine location permission if not already granted
if (!UnityEngine.Android.Permission.HasUserAuthorizedPermission(UnityEngine.Android.Permission.FineLocation))
{
UnityEngine.Android.Permission.RequestUserPermission(UnityEngine.Android.Permission.FineLocation);
// Wait up to 10 seconds for user to respond to the permission dialog
float waited = 0f;
while (!UnityEngine.Android.Permission.HasUserAuthorizedPermission(UnityEngine.Android.Permission.FineLocation) && waited < 10f)
{
yield return new WaitForSeconds(0.5f);
waited += 0.5f;
}
}
#endif
if (!Input.location.isEnabledByUser)
{
Debug.LogError("Location not enabled on device or app does not have permission to access location");
_GPSState = GPSState.Failed;
yield break;
}
// Starts the location service.
float desiredAccuracyInMeters = 10f;
float updateDistanceInMeters = 10f;
float desiredAccuracyInMeters = 5f;
float updateDistanceInMeters = 1f;
Input.location.Start(desiredAccuracyInMeters, updateDistanceInMeters);
@@ -225,30 +257,34 @@ namespace Subsystems
Debug.LogError("Timed out");
yield break;
}
_GPSState = GPSState.Running;
yield return _coroutineHost.StartCoroutine(GPSService());
}
IEnumerator GPSService()
{
// Check if the user has location service enabled.
// If the connection failed this cancels location service use.
if (Input.location.status == LocationServiceStatus.Failed)
{
_GPSState = GPSState.Failed;
Debug.LogError("Unable to determine device location");
yield break;
}
else
{
// If the connection succeeded, this retrieves the device's current location and displays it in the Console window.
_currentPosition = new Position(Input.location.lastData.latitude, Input.location.lastData.longitude);
Debug.Log("Location: " + Input.location.lastData.latitude + " " + Input.location.lastData.longitude + " " + Input.location.lastData.altitude + " " + Input.location.lastData.horizontalAccuracy + " " + Input.location.lastData.timestamp);
yield return new WaitForSeconds(5f);
}
// Stops the location service if there is no need to query location updates continuously.
yield return _coroutineHost.StartCoroutine(GPSService());
_GPSState = GPSState.Running;
_gpsRetryCount = 0;
_coroutineHost.StartCoroutine(GPSService());
}
IEnumerator GPSService()
{
while (_GPSState == GPSState.Running)
{
if (Input.location.status == LocationServiceStatus.Failed)
{
_GPSState = GPSState.Failed;
Debug.LogError("Unable to determine device location");
yield break;
}
// Keep current GPS position fresh; sending is throttled in positionCheck().
var data = Input.location.lastData;
_currentPosition = new Position(data.latitude, data.longitude);
yield return new WaitForSeconds(0.5f);
}
}
}
}

View File

@@ -3,9 +3,7 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using UnityEditor;
using UnityEngine;
using UnityEngine.Localization.Pseudo;
using UnityEngine.UI;
@@ -13,8 +11,8 @@ namespace Subsystems{
[System.Serializable]
public class BuildingSettings
{
public Material ResidentalBuildingsMat;
public float ResidentalBuildingHeight;
public Material ResidentialBuildingsMat;
public float ResidentialBuildingHeight;
public Material CommercialBuildingsMat;
public float CommercialBuildingHeight;
public Material IndustrialBuildingsMat;
@@ -65,7 +63,14 @@ namespace Subsystems{
private BuildingSettings _buildingSettings;
private PathwaySettings _pathwaySettings;
private AreaSettings _areaSettings;
private const float _metersPerUnit = 1f;
private const float _metersPerUnit = 1f;
// Runtime marker collections
private Dictionary<string, GameObject> _taskMarkers = new Dictionary<string, GameObject>();
private Dictionary<string, GameObject> _bodyMarkers = new Dictionary<string, GameObject>();
private Dictionary<string, GameObject> _playerAvatars = new Dictionary<string, GameObject>();
private List<GameObject> _sabotageMarkers = new List<GameObject>();
public GameManager_Map(GameClient gameClient, GameObject mapCenterPoint, BuildingSettings buildingSettings, PathwaySettings pathwaySettings, AreaSettings areaSettings)
{
_gameClient = gameClient;
@@ -74,8 +79,25 @@ namespace Subsystems{
_pathwaySettings = pathwaySettings;
_areaSettings = areaSettings;
}
public bool IsSceneReady => _mapCenterPoint != null;
/// <summary>Called from OnSceneLoaded when Client.unity is loaded so the
/// MapCenterPoint (which lives in Client.unity) can be wired at runtime.</summary>
public void SetMapCenterPoint(GameObject go) { _mapCenterPoint = go; }
public void BuildMap()
{
if (_mapCenterPoint == null)
{
Debug.LogWarning("[Map] BuildMap skipped: MapCenterPoint is not yet bound.");
return;
}
if (_gameClient?.CurrentLobbyState?.MapData == null)
{
Debug.LogWarning("[Map] BuildMap skipped: no MapData in CurrentLobbyState.");
return;
}
ClearChildren();
_centerPosition = _gameClient.CurrentLobbyState.MapData.Center;
GameObject buildingsRoot = new GameObject("Buildings");
@@ -139,8 +161,8 @@ namespace Subsystems{
switch (b.BuildingType.ToLower())
{
case "residential":
mat = _buildingSettings.ResidentalBuildingsMat;
height = _buildingSettings.ResidentalBuildingHeight;
mat = _buildingSettings.ResidentialBuildingsMat;
height = _buildingSettings.ResidentialBuildingHeight;
break;
case "commercial":
mat = _buildingSettings.CommercialBuildingsMat;
@@ -372,5 +394,117 @@ namespace Subsystems{
return mesh;
}
#endregion
#region Markers
public void CreateTaskMarkers(List<GeoSus.Client.GameTask> tasks)
{
if (_mapCenterPoint == null) return;
if (_centerPosition.Lat == 0 && _centerPosition.Lon == 0)
{
var md = _gameClient?.CurrentLobbyState?.MapData;
if (md != null) _centerPosition = md.Center;
}
if (_centerPosition.Lat == 0 && _centerPosition.Lon == 0) return;
foreach (var task in tasks)
{
if (_taskMarkers.ContainsKey(task.TaskId)) continue;
var go = GameObject.CreatePrimitive(PrimitiveType.Sphere);
go.name = $"Task_{task.TaskId}";
go.transform.parent = _mapCenterPoint.transform;
go.transform.position = task.Location.ToLocalVector3(_centerPosition) + Vector3.up * 0.3f;
go.transform.localScale = Vector3.one * 0.5f;
var mr = go.GetComponent<MeshRenderer>();
if (mr) mr.material.color = Color.yellow;
_taskMarkers[task.TaskId] = go;
}
}
public void RemoveTaskMarker(string taskId)
{
if (_taskMarkers.TryGetValue(taskId, out var go))
{
UnityEngine.Object.Destroy(go);
_taskMarkers.Remove(taskId);
}
}
public void CreateBodyMarker(string bodyId, Position location)
{
if (_mapCenterPoint == null) return;
if (_bodyMarkers.ContainsKey(bodyId)) return;
var go = GameObject.CreatePrimitive(PrimitiveType.Capsule);
go.name = $"Body_{bodyId}";
go.transform.parent = _mapCenterPoint?.transform;
go.transform.position = location.ToLocalVector3(_centerPosition) + Vector3.up * 0.15f;
go.transform.localScale = new Vector3(0.3f, 0.5f, 0.3f);
go.transform.rotation = Quaternion.Euler(90, 0, 0); // lying down
var mr = go.GetComponent<MeshRenderer>();
if (mr) mr.material.color = Color.red;
_bodyMarkers[bodyId] = go;
}
public void ClearBodyMarkers()
{
foreach (var go in _bodyMarkers.Values)
if (go) UnityEngine.Object.Destroy(go);
_bodyMarkers.Clear();
}
public void UpdatePlayerAvatars(Dictionary<string, PlayerPositionInfo> positions, string myUuid)
{
if (_mapCenterPoint == null) return;
if (_centerPosition.Lat == 0 && _centerPosition.Lon == 0)
{
var md = _gameClient?.CurrentLobbyState?.MapData;
if (md != null) _centerPosition = md.Center;
}
if (_centerPosition.Lat == 0 && _centerPosition.Lon == 0) return;
foreach (var kvp in positions)
{
string uuid = kvp.Key;
var info = kvp.Value;
if (!_playerAvatars.TryGetValue(uuid, out var go) || go == null)
{
go = GameObject.CreatePrimitive(PrimitiveType.Capsule);
go.name = $"Player_{uuid.Substring(0, Mathf.Min(8, uuid.Length))}";
go.transform.parent = _mapCenterPoint?.transform;
go.transform.localScale = Vector3.one * 0.4f;
_playerAvatars[uuid] = go;
}
go.transform.position = info.Position.ToLocalVector3(_centerPosition) + Vector3.up * 1f;
var mr = go.GetComponent<MeshRenderer>();
if (mr)
{
if (uuid == myUuid) mr.material.color = Color.green;
else if (info.State == GeoSus.Client.PlayerState.Dead) mr.material.color = Color.grey;
else mr.material.color = Color.white;
}
}
}
public void CreateSabotageMarkers(List<RepairStationInfo> stations)
{
foreach (var station in stations)
{
var go = GameObject.CreatePrimitive(PrimitiveType.Cylinder);
go.name = $"Sabotage_{station.StationId}";
go.transform.parent = _mapCenterPoint?.transform;
go.transform.position = station.Location.ToLocalVector3(_centerPosition) + Vector3.up * 1f;
go.transform.localScale = new Vector3(0.5f, 2f, 0.5f);
var mr = go.GetComponent<MeshRenderer>();
if (mr) mr.material.color = new Color(1f, 0.5f, 0f); // orange
_sabotageMarkers.Add(go);
}
}
public void ClearSabotageMarkers()
{
foreach (var go in _sabotageMarkers)
if (go) UnityEngine.Object.Destroy(go);
_sabotageMarkers.Clear();
}
#endregion
}
}

View File

@@ -5,6 +5,7 @@ using UnityEngine;
using System.Collections.Generic;
using Subsystems;
using System.Linq;
using UnityEngine.SceneManagement;
namespace Subsystems
{
@@ -13,9 +14,20 @@ namespace Subsystems
private const string _serverAddress = "geosus.honzuvkod.dev";
private const int _serverPort = 7777;
private GameClient _gameClient;
private GameManager_Map _mapSubsystem;
public async void OpenConection()
private GameManager _manager; // may be null for test clients
private bool _pendingMapBuild;
public GameManager_Network(GameClient gameClient, GameManager manager)
{
_gameClient = gameClient;
_manager = manager;
RegisterEventHandlers();
}
public async void OpenConnection()
{
int retries = 0;
int delayMs = 5000;
while (true)
{
Task<bool> state = _gameClient.ConnectAsync(_serverAddress, _serverPort);
@@ -25,18 +37,18 @@ namespace Subsystems
Debug.Log("Connected to server.");
break;
}
else
retries++;
if (retries >= 10)
{
Debug.Log("Failed to connect to server");
Debug.LogError("Failed to connect after 10 attempts. Giving up.");
break;
}
await Task.Delay(5000);
Debug.Log($"Failed to connect (attempt {retries}). Retrying in {delayMs / 1000}s...");
await Task.Delay(delayMs);
delayMs = Mathf.Min(delayMs * 2, 30000); // exponential backoff, cap 30s
}
}
public GameManager_Network(GameClient gameClient)
{
_gameClient = gameClient;
RegisterEventHandlers();
}
public void RegisterEventHandlers()
{
_gameClient.OnConnected += OnConnected;
@@ -45,117 +57,307 @@ namespace Subsystems
_gameClient.OnMessage += OnMessage;
_gameClient.OnGameEvent += OnGameEvent;
}
private void OnConnected()
{
Debug.Log("Successfully connected to the server.");
}
private void OnDisconnected(string reason)
{
Debug.Log($"Host disconnected due to {reason}");
Debug.Log($"Disconnected: {reason}");
// Auto-reconnect unless the app is quitting
if (reason != "Disposed" && _manager != null)
_manager.StartCoroutine(ReconnectAfterDelay(3f));
}
private System.Collections.IEnumerator ReconnectAfterDelay(float seconds)
{
yield return new UnityEngine.WaitForSeconds(seconds);
Debug.Log("Attempting to reconnect...");
OpenConnection();
}
private void OnError(string error)
{
Debug.LogError($"Network error: {error}");
}
private void OnMessage(Message message)
{
switch (message.Type)
{
case "GameEvent":
OnGameEvent(message as GameEvent);
// handled via OnGameEvent
break;
case "CreateLobbyResponse":
Debug.Log("Received CreateLobbyResponse message");
HandleCreateLobbyResponse(message as CreateLobbyResponse);
break;
case "JoinLobbyResponse":
Debug.Log("Received JoinLobbyResponse message");
HandleJoinLobbyResponse(message as JoinLobbyResponse);
break;
case "PositionBroadcast":
HandlePositionBroadcast(message as PositionBroadcast);
break;
case "Ack":
Debug.Log("Received Ack message");
break;
default:
Debug.Log("Received message of type: " + message.Type);
break;
}
}
private void OnGameEvent(GameEvent gameEvent)
{
switch (gameEvent.EventType)
{
case "PlayerJoined":
Debug.Log($"Player {gameEvent.GetPayload<PlayerJoinedPayload>().DisplayName} joined");
break;
case "PlayerLeft":
Debug.Log($"Player {gameEvent.GetPayload<PlayerLeftPayload>()} left");
case "HostChanged":
// SDK already updates CurrentLobbyState; just refresh UI
_manager?.uiSubsystem?.NotifyLobbyChanged();
break;
case "GameStarting":
Debug.Log("Game is starting!");
break;
case "GameStarted":
Debug.Log("Game started");
HandleGameStarting();
break;
case "MapDataReady":
Debug.Log("Map data ready");
HandleMapDataReady();
break;
case "PlayerMapDataReceived":
Debug.Log("Player map data recieved");
case "GameStarted":
HandleGameStarted();
break;
case "RoleAssigned":
HandleRoleAssigned(gameEvent);
break;
case "TaskCompleted":
HandleTaskCompleted(gameEvent);
break;
case "PlayerKilled":
HandlePlayerKilled(gameEvent);
break;
case "BodyReported":
case "EmergencyMeetingCalled":
HandleMeetingCalled(gameEvent);
break;
case "MeetingStarted":
HandleMeetingStarted(gameEvent);
break;
case "VotingClosed":
HandleVotingClosed(gameEvent);
break;
case "GameEnded":
HandleGameEnded(gameEvent);
break;
case "ReturnedToLobby":
HandleReturnedToLobby();
break;
case "SabotageStarted":
HandleSabotageStarted(gameEvent);
break;
case "SabotageRepaired":
case "SabotageMeltdown":
_manager?.uiSubsystem?.HideSabotageTimer();
_manager?.mapSubsystem?.ClearSabotageMarkers();
break;
case "MapDataError":
Debug.Log("Received MapData server error");
Debug.LogError("Server could not generate map data.");
break;
default:
Debug.Log("Received GameEvent of type: " + gameEvent.EventType);
Debug.Log("GameEvent: " + gameEvent.EventType);
break;
}
}
// ── Lobby responses ───────────────────────────────────────────────────
private void HandleCreateLobbyResponse(CreateLobbyResponse message)
{
if (message == null) return;
if (message.Success)
{
Debug.Log("Lobby created successfully. Join Code: " + message.JoinCode + ", Lobby ID: " + message.LobbyId);
Debug.Log($"Lobby created. Code: {message.JoinCode}, ID: {message.LobbyId}");
// Navigate to the create/waiting scene
SceneManager.LoadScene("create", LoadSceneMode.Single);
// Mark lobby UI dirty so LobbyDisplayUI refreshes once the scene is loaded
_manager?.uiSubsystem?.NotifyLobbyChanged();
}
else
{
Debug.LogError("Failed to create lobby: " + message.Error);
}
}
private void HandleJoinLobbyResponse(JoinLobbyResponse message)
{
if (message == null) return;
if (message.Success)
{
Debug.Log("Lobby created successfully." + ", Lobby ID: " + message.LobbyId);
Debug.Log($"Joined lobby: {message.LobbyId}");
SceneManager.LoadScene("join loading", LoadSceneMode.Single);
// Mark lobby UI dirty so LobbyDisplayUI refreshes once the scene is loaded
_manager?.uiSubsystem?.NotifyLobbyChanged();
}
else
{
Debug.LogError("Failed to create lobby: " + message.Error);
Debug.LogError("Failed to join lobby: " + message.Error);
}
}
public void CrateLobby(double lat, double lon)
// ── Game flow events ──────────────────────────────────────────────────
private void HandleGameStarting()
{
_gameClient.CreateLobby(new Position(lat, lon));
_pendingMapBuild = false;
// SDK sets Phase = Loading; load Client.unity
SceneManager.LoadScene("Client", LoadSceneMode.Single);
}
private void HandleMapDataReady()
{
_pendingMapBuild = true;
TryBuildMapAndMarkers();
}
/// <summary>
/// Called from GameManager.OnSceneLoaded("Client") after scene objects are bound.
/// Ensures map construction still happens even if MapDataReady arrived earlier.
/// </summary>
public void OnClientSceneReady()
{
TryBuildMapAndMarkers();
}
private void TryBuildMapAndMarkers()
{
if (!_pendingMapBuild) return;
if (_manager?.mapSubsystem == null) return;
if (!_manager.mapSubsystem.IsSceneReady) return;
if (_gameClient?.CurrentLobbyState?.MapData == null) return;
_manager.mapSubsystem.BuildMap();
_manager.mapSubsystem.CreateTaskMarkers(_gameClient.MyTasks);
_pendingMapBuild = false;
Debug.Log("[Network] Map built and task markers refreshed.");
}
private void HandleGameStarted()
{
Debug.Log("Game started");
// Phase is now Playing; GPS loop will start sending positions
}
private void HandleRoleAssigned(GameEvent evt)
{
var payload = evt.GetPayload<RoleAssignedPayload>();
if (payload == null || payload.ClientUuid != _gameClient.ClientUuid) return;
Debug.Log($"Role: {payload.Role}, Tasks: {payload.Tasks?.Count ?? 0}");
_manager?.taskSubsystem?.Initialize(_gameClient.MyTasks);
}
private void HandleTaskCompleted(GameEvent evt)
{
var payload = evt.GetPayload<TaskCompletedPayload>();
if (payload == null) return;
_manager?.uiSubsystem?.UpdateTaskProgress(payload.TotalCompleted, payload.TotalTasks);
_manager?.mapSubsystem?.RemoveTaskMarker(payload.TaskId);
}
private void HandlePlayerKilled(GameEvent evt)
{
var payload = evt.GetPayload<PlayerKilledPayload>();
if (payload == null) return;
_manager?.mapSubsystem?.CreateBodyMarker(payload.BodyId, payload.Location);
if (payload.VictimId == _gameClient.ClientUuid)
_manager?.uiSubsystem?.OnLocalPlayerDied();
}
private void HandleMeetingCalled(GameEvent evt)
{
_manager?.uiSubsystem?.ShowMeetingAlert();
}
private void HandleMeetingStarted(GameEvent evt)
{
var payload = evt.GetPayload<MeetingStartedPayload>();
if (payload == null) return;
_manager?.uiSubsystem?.ShowMeetingPanel(_gameClient.CurrentLobbyState?.Players, payload);
}
private void HandleVotingClosed(GameEvent evt)
{
var payload = evt.GetPayload<VotingClosedPayload>();
if (payload == null) return;
_manager?.uiSubsystem?.ShowVoteResult(payload, _gameClient.CurrentLobbyState?.Players);
_manager?.mapSubsystem?.ClearBodyMarkers();
}
private void HandleGameEnded(GameEvent evt)
{
var payload = evt.GetPayload<GameEndedPayload>();
if (payload == null) return;
_manager?.uiSubsystem?.ShowGameEndPanel(payload, _gameClient.ClientUuid);
}
private void HandleReturnedToLobby()
{
if (_gameClient.IsOwner)
SceneManager.LoadScene("create", LoadSceneMode.Single);
else
SceneManager.LoadScene("join loading", LoadSceneMode.Single);
}
private void HandleSabotageStarted(GameEvent evt)
{
var payload = evt.GetPayload<SabotageStartedPayload>();
if (payload == null) return;
_manager?.mapSubsystem?.CreateSabotageMarkers(payload.RepairStations);
if (payload.Type == SabotageType.CriticalMeltdown && payload.Deadline.HasValue)
_manager?.uiSubsystem?.ShowSabotageTimer(payload.Deadline.Value);
if (payload.Type == SabotageType.CommsBlackout)
_manager?.uiSubsystem?.SetCommsBlackout(true);
}
private void HandlePositionBroadcast(PositionBroadcast broadcast)
{
if (broadcast == null) return;
_manager?.mapSubsystem?.UpdatePlayerAvatars(_gameClient.PlayerPositions, _gameClient.ClientUuid);
}
// ── Send helpers ──────────────────────────────────────────────────────
public void CreateLobby(double lat, double lon, double radius = 500, int impostorCount = 1, int taskCount = 5)
{
_gameClient.CreateLobby(new Position(lat, lon), impostorCount, taskCount, null, radius);
}
public void JoinLobby(string joinCode)
{
try
{
_gameClient.JoinLobby(joinCode);
}
catch (System.Exception ex)
{
Debug.LogError("Error joining lobby: " + ex.Message);
}
try { _gameClient.JoinLobby(joinCode); }
catch (System.Exception ex) { Debug.LogError("JoinLobby error: " + ex.Message); }
}
public void LeaveLobby()
{
_gameClient.Disconnect();
Application.Quit();
_gameClient.LeaveLobby();
SceneManager.LoadScene(_manager?.firstMenuScene ?? "main menu asi idk lol", LoadSceneMode.Single);
}
public void StartGame()
{
_gameClient.StartGame();
}
}
}

View File

@@ -0,0 +1,213 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using GeoSus.Client;
namespace Subsystems
{
/// <summary>
/// Round-robin task-to-minigame assignment, proximity detection, additive scene launch.
/// </summary>
public class GameManager_Tasks
{
private class TaskEntry
{
public GeoSus.Client.GameTask ServerTask;
public string MinigameScene;
public bool Completed;
}
private GameClient _gameClient;
private string[] _minigameScenes;
private MonoBehaviour _host; // GameManager MonoBehaviour for coroutines
private List<TaskEntry> _tasks = new List<TaskEntry>();
private bool _minigameOpen;
private string _loadedMinigameScene;
// Proximity state (checked every frame in UpdateProximity)
public GeoSus.Client.GameTask NearbyTask { get; private set; }
private const float ProximityRadius = 5f; // metres / Unity units
public GameManager_Tasks(GameClient gameClient, string[] minigameScenes, MonoBehaviour host)
{
_gameClient = gameClient;
_minigameScenes = minigameScenes ?? new string[0];
_host = host;
}
/// <summary>Called by Network subsystem when RoleAssigned fires.</summary>
public void Initialize(List<GeoSus.Client.GameTask> serverTasks)
{
_tasks.Clear();
if (_minigameScenes.Length == 0) return;
for (int i = 0; i < serverTasks.Count; i++)
{
_tasks.Add(new TaskEntry
{
ServerTask = serverTasks[i],
MinigameScene = _minigameScenes[i % _minigameScenes.Length],
Completed = false
});
}
// Create map markers
GameManager.Instance?.mapSubsystem?.CreateTaskMarkers(serverTasks);
Debug.Log($"[Tasks] Initialized {_tasks.Count} tasks.");
}
/// <summary>Called every frame from GameManager.Update().</summary>
public void UpdateProximity()
{
if (_minigameOpen) return;
NearbyTask = null;
var myPos = _gameClient.MyPosition;
if (myPos.Lat == 0 && myPos.Lon == 0) return;
foreach (var entry in _tasks)
{
if (entry.Completed) continue;
double dist = myPos.DistanceTo(entry.ServerTask.Location);
if (dist <= ProximityRadius)
{
NearbyTask = entry.ServerTask;
break;
}
}
// Drive the action button in UI
var ui = GameManager.Instance?.uiSubsystem;
if (ui == null || ui.IsPlayerDead) return;
bool isImpostor = _gameClient.MyRole == GeoSus.Client.PlayerRole.Impostor;
if (!isImpostor && NearbyTask != null)
{
ui.SetActionButton("USE", true, () => GameManager.Instance?.PerformAction());
return;
}
// Check body proximity
if (!ui.IsCommsBlackout)
{
var body = _gameClient.FindNearbyBody(ProximityRadius);
if (body != null)
{
ui.SetActionButton("REPORT", true, () => GameManager.Instance?.PerformAction());
return;
}
// Emergency meeting proximity
if (_gameClient.CurrentLobbyState?.MapData != null)
{
double dist = myPos.DistanceTo(_gameClient.CurrentLobbyState.MapData.Center);
if (dist <= ProximityRadius)
{
ui.SetActionButton("EMERGENCY", true, () => GameManager.Instance?.PerformAction());
return;
}
}
}
// Impostor kill
if (isImpostor)
{
var target = _gameClient.FindNearbyPlayer(ProximityRadius);
if (!string.IsNullOrEmpty(target))
{
ui.SetActionButton("KILL", true, () => GameManager.Instance?.PerformAction());
return;
}
}
// Nothing nearby
ui.SetActionButton("", false);
}
/// <summary>Called externally (e.g., GameManager.PerformAction) to launch the nearby task.</summary>
public void TriggerNearbyTask()
{
OnUsePressed();
}
private void OnUsePressed()
{
if (NearbyTask == null || _minigameOpen) return;
var entry = _tasks.Find(t => t.ServerTask.TaskId == NearbyTask.TaskId);
if (entry != null) _host.StartCoroutine(LaunchMinigame(entry));
}
private IEnumerator LaunchMinigame(TaskEntry entry)
{
_minigameOpen = true;
Debug.Log($"[Tasks] Launching minigame '{entry.MinigameScene}' for task '{entry.ServerTask.Name}'");
// Inform server that task started
_gameClient.Send(new TaskStart { TaskId = entry.ServerTask.TaskId });
var op = SceneManager.LoadSceneAsync(entry.MinigameScene, LoadSceneMode.Additive);
yield return op;
_loadedMinigameScene = entry.MinigameScene;
// Find the ITask component in the newly loaded scene
Scene scene = SceneManager.GetSceneByName(entry.MinigameScene);
ITask taskComponent = null;
foreach (var root in scene.GetRootGameObjects())
{
taskComponent = root.GetComponentInChildren<ITask>();
if (taskComponent != null) break;
}
if (taskComponent == null)
{
Debug.LogWarning($"[Tasks] No ITask found in '{entry.MinigameScene}'. Auto-completing.");
yield return FinishMinigame(entry, true);
yield break;
}
// Set task metadata
taskComponent.TaskID = entry.ServerTask.TaskId;
taskComponent.TaskName = entry.ServerTask.Name;
taskComponent.TaskLocation = (entry.ServerTask.Location.Lat, entry.ServerTask.Location.Lon);
bool done = false;
bool exited = false;
taskComponent.Initialize(t => { done = true; });
taskComponent.ExitTask(t => { exited = true; });
// Wait for completion or exit
yield return new WaitUntil(() => done || exited);
yield return FinishMinigame(entry, done);
}
private IEnumerator FinishMinigame(TaskEntry entry, bool completed)
{
if (completed)
{
entry.Completed = true;
_gameClient.CompleteTask(entry.ServerTask.TaskId);
Debug.Log($"[Tasks] Task '{entry.ServerTask.Name}' completed.");
}
else
{
Debug.Log($"[Tasks] Task '{entry.ServerTask.Name}' exited without completion.");
}
// Unload minigame scene
if (!string.IsNullOrEmpty(_loadedMinigameScene))
{
var unload = SceneManager.UnloadSceneAsync(_loadedMinigameScene);
yield return unload;
_loadedMinigameScene = null;
}
_minigameOpen = false;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 27a123dbda9eef8ba4815c0c0d30b6fb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,71 +1,346 @@
using UnityEngine;
using UnityEngine.UI;
using Subsystems;
using GeoSus.Client;
using System.ComponentModel;
using System.Threading;
using System.Collections.Generic;
using System;
using TMPro;
namespace Subsystems
{
/// <summary>
/// Manages UI for the GameManager. Canvas references are only valid in Client.unity;
/// Art-menu scenes use their own lightweight UI scripts that read from GameManager.Instance.
/// </summary>
public class GameManager_UI
{
private GameClient _gameClient;
private Canvas _CreateJoinLobby;
private Canvas _InLobby;
private Canvas _LoadingScreen;
private Canvas _GameScreen;
public GameManager_UI(GameClient gameClient, Canvas CreateJoinLobby, Canvas InLobby, Canvas LoadingScreen, Canvas GameScreen)
// Set by GameManager after Client.unity loads (called from GameManager.OnSceneLoaded)
public Canvas ClientCreateJoinLobby; // fallback join-code canvas in Client.unity
public Canvas ClientInLobby; // InLobby canvas in Client.unity (unused now, kept compat)
public Canvas ClientLoadingScreen;
public Canvas ClientGameScreen; // parent of all HUD elements
// HUD elements (children of ClientGameScreen, resolved at runtime)
private TMP_Text _roleText;
private TMP_Text _taskListText;
private TMP_Text _taskProgressText;
private Button _actionButton;
private TMP_Text _actionButtonText;
private TMP_Text _killCooldownText;
private GameObject _sabotagePanel;
private TMP_Text _sabotageTimerText;
private GameObject _meetingPanel;
private GameObject _gameEndPanel;
private TMP_Text _gameEndText;
// Runtime state
private bool _isDead;
private bool _commsBlackout;
private DateTime _sabotageMeltdownDeadline;
private bool _sabotageTimerActive;
// Lobby-changed flag — set from network thread, consumed in Update
private volatile bool _lobbyDirty;
public GameManager_UI(GameClient gameClient)
{
_gameClient = gameClient;
_CreateJoinLobby = CreateJoinLobby;
_LoadingScreen = LoadingScreen;
_GameScreen = GameScreen;
_InLobby = InLobby;
_CreateJoinLobby.enabled = true;
_InLobby.enabled = false;
_GameScreen.enabled = false;
_LoadingScreen.enabled = false;
}
/// <summary>Called by Network subsystem when lobby player list changes.</summary>
public void NotifyLobbyChanged() => _lobbyDirty = true;
// ── Called from GameManager after Client.unity loads ──────────────────
public void BindClientScene(Canvas createJoin, Canvas inLobby, Canvas loading, Canvas game)
{
ClientCreateJoinLobby = createJoin;
ClientInLobby = inLobby;
ClientLoadingScreen = loading;
ClientGameScreen = game;
EnsureCanvasReady(createJoin);
EnsureCanvasReady(inLobby);
EnsureCanvasReady(loading);
EnsureCanvasReady(game);
if (createJoin) createJoin.gameObject.SetActive(false);
if (inLobby) inLobby.gameObject.SetActive(false);
if (loading) loading.gameObject.SetActive(false);
if (game) game.gameObject.SetActive(false);
if (game != null)
{
_roleText = FindTMP(game.transform, "Role");
_taskListText = FindTMP(game.transform, "TaskList");
_taskProgressText = FindTMP(game.transform, "TaskProgress");
_killCooldownText = FindTMP(game.transform, "KillCooldown");
_sabotageTimerText = FindTMP(game.transform, "SabotageTimer");
_gameEndText = FindTMP(game.transform, "GameEndText");
var actionGO = game.transform.Find("ActionButton");
if (actionGO != null)
{
_actionButton = actionGO.GetComponent<Button>();
_actionButtonText = actionGO.GetComponentInChildren<TMP_Text>();
}
var sabGO = game.transform.Find("SabotagePanel");
_sabotagePanel = sabGO?.gameObject;
var meetGO = game.transform.Find("MeetingPanel");
_meetingPanel = meetGO?.gameObject;
if (_meetingPanel) _meetingPanel.SetActive(false);
var endGO = game.transform.Find("GameEndPanel");
_gameEndPanel = endGO?.gameObject;
if (_gameEndPanel) _gameEndPanel.SetActive(false);
}
}
// ── Main update (called every frame from GameManager.Update) ──────────
public void UpdateLobbyUI()
{
if (_gameClient.CurrentLobbyState == null)
var state = _gameClient.CurrentLobbyState;
if (state == null) return;
// Update any LobbyDisplayUI listeners in the current scene
if (_lobbyDirty)
{
_CreateJoinLobby.enabled = true;
_InLobby.enabled = false;
_GameScreen.enabled = false;
_LoadingScreen.enabled = false;
return;
_lobbyDirty = false;
LobbyDisplayUI.RefreshAll(state);
}
else if (_gameClient.CurrentLobbyState.Phase == GamePhase.Loading)
// Only do canvas switches if we are in Client.unity (canvases assigned)
if (ClientGameScreen == null) return;
switch (state.Phase)
{
_CreateJoinLobby.enabled = false;
_InLobby.enabled = false;
_GameScreen.enabled = false;
_LoadingScreen.enabled = true;
return;
case GamePhase.Loading:
SetCanvases(false, false, true, false);
break;
case GamePhase.Lobby:
SetCanvases(false, true, false, false);
break;
case GamePhase.Playing:
case GamePhase.Meeting:
case GamePhase.Voting:
SetCanvases(false, false, false, true);
UpdateGameHUD();
break;
case GamePhase.Ended:
// GameEndPanel shown by HandleGameEnded
break;
}
else if (_gameClient.CurrentLobbyState.Phase == GamePhase.Lobby)
}
private void UpdateGameHUD()
{
if (_roleText != null) _roleText.text = _gameClient.MyRole?.ToString() ?? "";
// Task list
if (_taskListText != null)
{
_InLobby.enabled = true;
_CreateJoinLobby.enabled = false;
var playerList = _InLobby.transform.Find("PlayerList").GetComponent<TMPro.TMP_Text>();
playerList.text = "";
foreach (var player in _gameClient.CurrentLobbyState.Players)
var sb = new System.Text.StringBuilder();
foreach (var t in _gameClient.MyTasks)
sb.AppendLine(t.Name);
_taskListText.text = sb.ToString();
}
// Kill cooldown (managed by GameManager_Tasks via Update)
// Sabotage timer
if (_sabotageTimerActive && _sabotageTimerText != null)
{
double remaining = (_sabotageMeltdownDeadline - DateTime.UtcNow).TotalSeconds;
_sabotageTimerText.text = remaining > 0 ? $"MELTDOWN: {remaining:F0}s" : "MELTDOWN!";
}
}
// ── Helpers called by Network handlers ────────────────────────────────
public void SetKillCooldownText(string text)
{
if (_killCooldownText != null)
{
_killCooldownText.text = text;
_killCooldownText.gameObject.SetActive(!string.IsNullOrEmpty(text));
}
}
public void UpdateTaskProgress(int completed, int total)
{
if (_taskProgressText != null)
_taskProgressText.text = $"Tasks: {completed}/{total}";
}
public void SetActionButton(string label, bool visible, UnityEngine.Events.UnityAction onClick = null)
{
if (_actionButton == null) return;
_actionButton.gameObject.SetActive(visible);
if (_actionButtonText != null) _actionButtonText.text = label;
if (onClick != null)
{
_actionButton.onClick.RemoveAllListeners();
_actionButton.onClick.AddListener(onClick);
}
}
public void OnLocalPlayerDied()
{
_isDead = true;
if (_roleText != null) _roleText.text = "GHOST";
}
public void ShowMeetingAlert()
{
Debug.Log("Meeting called! Run to meeting point.");
}
public void ShowMeetingPanel(List<PlayerInfo> players, MeetingStartedPayload payload)
{
if (_meetingPanel == null) return;
_meetingPanel.SetActive(true);
var header = FindTMP(_meetingPanel.transform, "MeetingHeader");
if (header != null)
header.text = payload.Type == MeetingType.BodyReport ? "BODY REPORTED!" : "EMERGENCY MEETING!";
// Build simple text list of players — full vote buttons need prefabs in Unity Editor
var playerList = FindTMP(_meetingPanel.transform, "MeetingPlayerList");
if (playerList != null && players != null)
{
var sb = new System.Text.StringBuilder();
foreach (var p in players)
sb.AppendLine($"{p.DisplayName} [{p.State}]");
playerList.text = sb.ToString();
}
// Wire skip button if it exists
var skipBtn = _meetingPanel.transform.Find("SkipButton")?.GetComponent<Button>();
if (skipBtn != null)
{
skipBtn.onClick.RemoveAllListeners();
skipBtn.onClick.AddListener(() => GameManager.Instance?.CastVote(null));
}
}
public void AppendVoteInstruction()
{
var playerList = FindTMP(_meetingPanel?.transform, "MeetingPlayerList");
if (playerList != null)
playerList.text += "\n[Tap a name] then press VOTE — or press SKIP";
}
public void ShowVoteResult(VotingClosedPayload payload, List<PlayerInfo> players)
{
if (_meetingPanel == null) return;
var resultText = FindTMP(_meetingPanel.transform, "VoteResult");
if (resultText != null)
{
if (payload.WasTie)
{
playerList.text += player.DisplayName + "\n";
resultText.text = "TIE — nobody ejected.";
}
else if (string.IsNullOrEmpty(payload.EjectedPlayerId))
{
resultText.text = "Skip — nobody ejected.";
}
else
{
var ejected = players?.Find(p => p.ClientUuid == payload.EjectedPlayerId);
resultText.text = $"{ejected?.DisplayName ?? payload.EjectedPlayerId} ejected!";
}
_InLobby.transform.Find("JoinCode").GetComponent<TMPro.TMP_Text>().text = _gameClient.CurrentLobbyState.JoinCode;
return;
}
else if (_gameClient.CurrentLobbyState.Phase == GamePhase.Playing)
// Close panel after 5 seconds — use coroutine via GameManager
GameManager.Instance?.StartCoroutine(CloseMeetingPanelAfterDelay(5f));
}
private System.Collections.IEnumerator CloseMeetingPanelAfterDelay(float delay)
{
yield return new UnityEngine.WaitForSeconds(delay);
if (_meetingPanel != null) _meetingPanel.SetActive(false);
}
public void ShowGameEndPanel(GameEndedPayload payload, string myUuid)
{
if (_gameEndPanel != null) _gameEndPanel.SetActive(true);
bool won = payload.Winners != null && payload.Winners.Contains(myUuid);
if (_gameEndText != null)
_gameEndText.text = $"{(won ? "VICTORY" : "DEFEAT")}\n{payload.WinningFaction} wins!\n{payload.Reason}";
}
public void ShowSabotageTimer(DateTime deadline)
{
_sabotageMeltdownDeadline = deadline;
_sabotageTimerActive = true;
if (_sabotageTimerText != null) _sabotageTimerText.gameObject.SetActive(true);
}
public void HideSabotageTimer()
{
_sabotageTimerActive = false;
if (_sabotageTimerText != null) _sabotageTimerText.gameObject.SetActive(false);
SetCommsBlackout(false);
}
public void SetCommsBlackout(bool active)
{
_commsBlackout = active;
}
public bool IsCommsBlackout => _commsBlackout;
public bool IsPlayerDead => _isDead;
// ── Utilities ─────────────────────────────────────────────────────────
private void SetCanvases(bool createJoin, bool inLobby, bool loading, bool game)
{
EnsureCanvasReady(ClientCreateJoinLobby);
EnsureCanvasReady(ClientInLobby);
EnsureCanvasReady(ClientLoadingScreen);
EnsureCanvasReady(ClientGameScreen);
if (ClientCreateJoinLobby) ClientCreateJoinLobby.gameObject.SetActive(createJoin);
if (ClientInLobby) ClientInLobby.gameObject.SetActive(inLobby);
if (ClientLoadingScreen) ClientLoadingScreen.gameObject.SetActive(loading);
if (ClientGameScreen) ClientGameScreen.gameObject.SetActive(game);
}
private static void EnsureCanvasReady(Canvas canvas)
{
if (canvas == null) return;
if (!canvas.enabled)
canvas.enabled = true;
// Some scene canvases are saved with zero scale, which makes UI invisible.
var t = canvas.transform;
if (t != null)
{
_CreateJoinLobby.enabled = false;
_InLobby.enabled = false;
_GameScreen.enabled = true;
_LoadingScreen.enabled = false;
_GameScreen.transform.Find("Role").GetComponent<TMPro.TMP_Text>().text = _gameClient.MyRole.ToString() ;
return;
var s = t.localScale;
if (Mathf.Abs(s.x) < 0.001f || Mathf.Abs(s.y) < 0.001f || Mathf.Abs(s.z) < 0.001f)
t.localScale = Vector3.one;
}
}
private static TMP_Text FindTMP(Transform root, string name)
{
if (root == null) return null;
foreach (var tmp in root.GetComponentsInChildren<TMP_Text>(true))
{
if (tmp != null && tmp.name == name)
return tmp;
}
return null;
}
}
}

View File

@@ -4,50 +4,18 @@ using UnityEngine;
public enum TaskType
{
Task //TODO: Typy úkolù
Task
}
public interface ITask
{
public string TaskID { get; } // Unikátní ID úkolu pro server
public TaskType TaskType { get; } // Typ úkolu
public string TaskName { get; } // Viditelný název úkolu
public (double, double) TaskLocation { get; } // Polohy na mapì
public bool IsCompleted { get; } // Stav dokonèení úkolu
public string TaskID { get; set; } // Unikátní ID úkolu pro server
public TaskType TaskType { get; set; } // Typ úkolu
public string TaskName { get; set; } // Viditelný název úkolu
public (double, double) TaskLocation { get; set; } // Poloha na mapě
public bool IsCompleted { get; } // Stav dokončení úkolu
void Initialize(Action<ITask> onCompleted); // Vytvoøení tasku + naètení postupu
void ExitTask(Action<ITask> onExit); // Pøi opuštìní úkolu poslat hotovo / uložit postup / reset
void Complete(); // Oznaèit úkol jako dokonèený, poslat na server a zavøít
}
/* Ukázoková implementace ITask
public class Wires : ITask{
public string TaskID { get; set; } // Unikátní ID úkolu pro server
public TaskType TaskType { get; set; } // Typ úkolu
public string TaskName { get; set; } // Viditelný název úkolu
public (double, double) TaskLocation { get; set; } // Poloha na mapì
public bool IsCompleted { get; private set; } // Stav dokonèení úkolu
private Action<ITask> _onCompleted;
public void Initialize(Action<ITask> onCompleted) // Vytvoøení tasku
{
IsCompleted = false;
_onCompleted = onCompleted;
}
public void ExitTask(Action<ITask> onExit) //Zavøení tasku
{
onExit?.Invoke(this);
}
public void Complete() // Dokonèení tasku a zavøení
{
IsCompleted = true;
_onCompleted?.Invoke(this);
ExitTask(null);
}
}
*/
void Initialize(Action<ITask> onCompleted); // Vytvoření tasku
void ExitTask(Action<ITask> onExit); // Při opuštění úkolu
void Complete(); // Označit úkol jako dokončený
}

8
Assets/Materials.meta Normal file
View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2230bf768ecb84610af77bea6cdd7074
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 16e75919ca33104489742cddec34a46f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,38 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Area_Default
m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Glossiness: 0.2
- _Metallic: 0
m_Colors:
- _Color: {r: 0.55, g: 0.78, b: 0.45, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 57c69638d7afff039a48123e7b4ade7b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,38 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Area_Forest
m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Glossiness: 0.2
- _Metallic: 0
m_Colors:
- _Color: {r: 0.15, g: 0.45, b: 0.15, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ef4ea3212671d276649ca366ed6e7f0c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,38 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Area_Park
m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Glossiness: 0.2
- _Metallic: 0
m_Colors:
- _Color: {r: 0.3, g: 0.7, b: 0.3, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 77b772132676975a3462e3aca2cfac0c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,38 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Area_Water
m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Glossiness: 0.2
- _Metallic: 0
m_Colors:
- _Color: {r: 0.2, g: 0.5, b: 0.9, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: eff7cc5b4e29f7918320d3979c3d0cb1
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,38 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Building_Commercial
m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Glossiness: 0.2
- _Metallic: 0
m_Colors:
- _Color: {r: 0.62, g: 0.62, b: 0.64, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: cade7a38e47c1b875f65cda2cf3b77c5
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,38 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Building_Default
m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Glossiness: 0.2
- _Metallic: 0
m_Colors:
- _Color: {r: 0.75, g: 0.74, b: 0.72, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1a50367e9d7460063dec2f85d18dde35
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,38 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Building_Industrial
m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Glossiness: 0.2
- _Metallic: 0
m_Colors:
- _Color: {r: 0.4, g: 0.38, b: 0.36, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4179f65aa390e873e96480f462d9fc3a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,38 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Building_Residential
m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Glossiness: 0.2
- _Metallic: 0
m_Colors:
- _Color: {r: 0.9, g: 0.82, b: 0.7, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d52b379b821c9ed624c15e9bd1420204
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,38 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Road_Cycleway
m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Glossiness: 0.2
- _Metallic: 0
m_Colors:
- _Color: {r: 0.35, g: 0.7, b: 0.35, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9ecf5df4890c0486002bf43baf684bab
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,38 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Road_Default
m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Glossiness: 0.2
- _Metallic: 0
m_Colors:
- _Color: {r: 0.4, g: 0.4, b: 0.42, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f831020d62c88ea9dfde83f98d539f55
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,38 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Road_Footway
m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Glossiness: 0.2
- _Metallic: 0
m_Colors:
- _Color: {r: 0.82, g: 0.76, b: 0.6, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a40e1c43763bb5c9b97d7999ac3c6f9d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,38 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Road_Path
m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Glossiness: 0.2
- _Metallic: 0
m_Colors:
- _Color: {r: 0.8, g: 0.74, b: 0.58, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
m_BuildTextureStacks: []
m_AllowLocking: 1

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b8c268a7008ed5031da152380545235d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 2651bd22cf5764e4eb358f11641edca2
guid: 7142a58f80866aba3ae4ffeb79d5f67c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0

View File

@@ -167,10 +167,10 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.CanvasScaler
m_UiScaleMode: 0
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ReferenceResolution: {x: 1600, y: 900}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
@@ -507,10 +507,10 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.CanvasScaler
m_UiScaleMode: 0
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ReferenceResolution: {x: 1600, y: 900}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
@@ -1262,7 +1262,7 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1353866372}
- m_Target: {fileID: 0}
m_TargetAssemblyTypeName: GameManager, Assembly-CSharp
m_MethodName: CreateLobbyButton
m_Mode: 1
@@ -1508,7 +1508,7 @@ MonoBehaviour:
m_text: Loading...
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2100000, guid: 9ad269c99dcf42b7aedefd83dd5a7b9d, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
@@ -1873,7 +1873,7 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1353866372}
- m_Target: {fileID: 0}
m_TargetAssemblyTypeName: GameManager, Assembly-CSharp
m_MethodName: JoinLobbyButton
m_Mode: 1
@@ -2142,7 +2142,7 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1353866372}
- m_Target: {fileID: 0}
m_TargetAssemblyTypeName: GameManager, Assembly-CSharp
m_MethodName: LeaveLobbyButton
m_Mode: 1
@@ -2192,96 +2192,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1304493835}
m_CullTransparentMesh: 1
--- !u!1 &1353866370
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1353866371}
- component: {fileID: 1353866372}
m_Layer: 0
m_Name: Game
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1353866371
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1353866370}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 56.6539, y: 0, z: 0.06448}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1353866372
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1353866370}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9e2c3e4ba4e36ea40a686e58feca4d2b, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::GameManager
displayName: Player
JoinCreateLobby: {fileID: 1403738864}
InLobby: {fileID: 12226903}
LoadingScreen: {fileID: 247614966}
GameScreen: {fileID: 1631266632}
MapCenterPoint: {fileID: 216559629}
buildingSettings:
ResidentalBuildingsMat: {fileID: 2100000, guid: 6744524496c8e1549882277283c132cc, type: 2}
ResidentalBuildingHeight: 3
CommercialBuildingsMat: {fileID: 2100000, guid: 6744524496c8e1549882277283c132cc, type: 2}
CommercialBuildingHeight: 10
IndustrialBuildingsMat: {fileID: 2100000, guid: 6744524496c8e1549882277283c132cc, type: 2}
IndustrialBuildingHeight: 5
DefaultBuildingMat: {fileID: 2100000, guid: 6744524496c8e1549882277283c132cc, type: 2}
DefaultBuildingHeight: 3
pathwaySettings:
FootwayMat: {fileID: 2100000, guid: 6744524496c8e1549882277283c132cc, type: 2}
FootwayWidth: 1
PathMat: {fileID: 2100000, guid: 6744524496c8e1549882277283c132cc, type: 2}
PathWidth: 1
StepsMat: {fileID: 2100000, guid: 6744524496c8e1549882277283c132cc, type: 2}
StepsWidth: 2
CyclewayMat: {fileID: 2100000, guid: 6744524496c8e1549882277283c132cc, type: 2}
CyclewayWidth: 2
PedestrianMat: {fileID: 2100000, guid: 6744524496c8e1549882277283c132cc, type: 2}
PedestrianWidth: 2
RoadMat: {fileID: 2100000, guid: 6744524496c8e1549882277283c132cc, type: 2}
RoadWidth: 5
ServiceMat: {fileID: 2100000, guid: 6744524496c8e1549882277283c132cc, type: 2}
ServiceWidth: 3
ResidentialMat: {fileID: 2100000, guid: 6744524496c8e1549882277283c132cc, type: 2}
ResidentialWidth: 5
TrackMat: {fileID: 2100000, guid: 6744524496c8e1549882277283c132cc, type: 2}
TrackWidth: 5
DefaultMat: {fileID: 2100000, guid: 6744524496c8e1549882277283c132cc, type: 2}
DefaultWidth: 5
areaSettings:
ParkMat: {fileID: 2100000, guid: 5a46533bdf4003449bc9146ccef44e27, type: 2}
GardenMat: {fileID: 2100000, guid: 5a46533bdf4003449bc9146ccef44e27, type: 2}
PlaygroundMat: {fileID: 2100000, guid: 5a46533bdf4003449bc9146ccef44e27, type: 2}
ForestMat: {fileID: 2100000, guid: 5a46533bdf4003449bc9146ccef44e27, type: 2}
GrassMat: {fileID: 2100000, guid: 5a46533bdf4003449bc9146ccef44e27, type: 2}
WaterMat: {fileID: 2100000, guid: 5a46533bdf4003449bc9146ccef44e27, type: 2}
DefaultMat: {fileID: 2100000, guid: 5a46533bdf4003449bc9146ccef44e27, type: 2}
Player: {fileID: 1161233721}
testMode: 1
--- !u!1 &1403738861
GameObject:
m_ObjectHideFlags: 0
@@ -2330,10 +2240,10 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.CanvasScaler
m_UiScaleMode: 0
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ReferenceResolution: {x: 1600, y: 900}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
@@ -2727,10 +2637,10 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.CanvasScaler
m_UiScaleMode: 0
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ReferenceResolution: {x: 1600, y: 900}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
@@ -2865,7 +2775,7 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1353866372}
- m_Target: {fileID: 0}
m_TargetAssemblyTypeName: GameManager, Assembly-CSharp
m_MethodName: StartGameButton
m_Mode: 1
@@ -3423,7 +3333,6 @@ SceneRoots:
m_Roots:
- {fileID: 1010702372}
- {fileID: 442151208}
- {fileID: 1353866371}
- {fileID: 1403738865}
- {fileID: 157221436}
- {fileID: 12226904}

View File

@@ -1223,6 +1223,54 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1614023714}
m_CullTransparentMesh: 1
--- !u!1 &1630498899
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1630498901}
- component: {fileID: 1630498900}
m_Layer: 0
m_Name: UIManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1630498900
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1630498899}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cef2287cbad97c8b8a4451dfb6a8e472, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::ConfirmLeaveUI
yesButton: {fileID: 0}
noButton: {fileID: 0}
mainMenuScene: main menu asi idk lol
previousScene: create
--- !u!4 &1630498901
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1630498899}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.21709, y: 0, z: 3.25431}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1703330983
GameObject:
m_ObjectHideFlags: 0
@@ -1311,7 +1359,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.CanvasScaler
m_UiScaleMode: 0
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 1600, y: 900}
@@ -1698,3 +1746,4 @@ SceneRoots:
- {fileID: 32068840}
- {fileID: 1105375119}
- {fileID: 1431640583}
- {fileID: 1630498901}

View File

@@ -1311,7 +1311,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.CanvasScaler
m_UiScaleMode: 0
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 1600, y: 900}

View File

@@ -931,7 +931,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.CanvasScaler
m_UiScaleMode: 0
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 1600, y: 900}

View File

@@ -1910,6 +1910,57 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &1685875757
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1685875759}
- component: {fileID: 1685875758}
m_Layer: 0
m_Name: UIManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1685875758
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1685875757}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 290610b7d8fb7ea675982694abac90ef, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::LobbyDisplayUI
lobbyCodeText: {fileID: 0}
playerListText: {fileID: 0}
maxPlayersText: {fileID: 0}
ownNameText: {fileID: 0}
otherNamesText: {fileID: 0}
statusText: {fileID: 0}
startButton: {fileID: 0}
--- !u!4 &1685875759
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1685875757}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.21709, y: 0, z: 3.25431}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1756995537
GameObject:
m_ObjectHideFlags: 0
@@ -2245,7 +2296,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.CanvasScaler
m_UiScaleMode: 0
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 1600, y: 900}
@@ -2317,3 +2368,4 @@ SceneRoots:
- {fileID: 999622380}
- {fileID: 514215624}
- {fileID: 794999493}
- {fileID: 1685875759}

View File

@@ -858,7 +858,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.CanvasScaler
m_UiScaleMode: 0
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 1600, y: 900}

View File

@@ -1147,7 +1147,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.CanvasScaler
m_UiScaleMode: 0
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 1600, y: 900}
@@ -1451,6 +1451,53 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::CudlikZmenaSceny
nazevCiloveSceny: main menu asi idk lol
--- !u!1 &1699332091
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1699332093}
- component: {fileID: 1699332092}
m_Layer: 0
m_Name: UIManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1699332092
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1699332091}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 60a81c1cb4f98a5b490fac0d3c1686b5, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::HostLobbyUI
radiusSlider: {fileID: 0}
radiusInput: {fileID: 0}
createButton: {fileID: 0}
--- !u!4 &1699332093
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1699332091}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.21709, y: 0, z: 3.25431}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1736735564
GameObject:
m_ObjectHideFlags: 0
@@ -2064,3 +2111,4 @@ SceneRoots:
- {fileID: 787926194}
- {fileID: 2039144269}
- {fileID: 795876785}
- {fileID: 1699332093}

View File

@@ -776,7 +776,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.CanvasScaler
m_UiScaleMode: 0
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 1600, y: 900}
@@ -2153,6 +2153,57 @@ Transform:
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2109176766
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2109176768}
- component: {fileID: 2109176767}
m_Layer: 0
m_Name: UiManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &2109176767
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2109176766}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 290610b7d8fb7ea675982694abac90ef, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::LobbyDisplayUI
lobbyCodeText: {fileID: 0}
playerListText: {fileID: 0}
maxPlayersText: {fileID: 0}
ownNameText: {fileID: 0}
otherNamesText: {fileID: 0}
statusText: {fileID: 0}
startButton: {fileID: 0}
--- !u!4 &2109176768
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2109176766}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.21709, y: 0, z: 3.25431}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
@@ -2162,3 +2213,4 @@ SceneRoots:
- {fileID: 84759318}
- {fileID: 1628273077}
- {fileID: 1867671051}
- {fileID: 2109176768}

View File

@@ -1091,7 +1091,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.CanvasScaler
m_UiScaleMode: 0
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 1600, y: 900}
@@ -1517,6 +1517,53 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1279141238}
m_CullTransparentMesh: 1
--- !u!1 &1474942541
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1474942543}
- component: {fileID: 1474942542}
m_Layer: 0
m_Name: UIManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1474942542
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1474942541}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0e0ca5d57a20e05215c36664ab8ff60e, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::JoinLobbyUI
codeInput: {fileID: 0}
joinButton: {fileID: 0}
errorText: {fileID: 0}
--- !u!4 &1474942543
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1474942541}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.21709, y: 0, z: 3.25431}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1484655921
GameObject:
m_ObjectHideFlags: 0
@@ -2414,3 +2461,4 @@ SceneRoots:
- {fileID: 649350973}
- {fileID: 1153626690}
- {fileID: 1620739952}
- {fileID: 1474942543}

View File

@@ -1358,7 +1358,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.CanvasScaler
m_UiScaleMode: 0
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 1600, y: 900}
@@ -2017,6 +2017,152 @@ Transform:
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 4.07, y: 171.97, z: 0}
--- !u!1 &1944735669
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1944735672}
- component: {fileID: 1944735671}
- component: {fileID: 1944735670}
m_Layer: 0
m_Name: UIManage
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1944735670
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1944735669}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a1305c74eacfaf90fd98134860492d46, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::PlayerNameInput
--- !u!114 &1944735671
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1944735669}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2da0c512f12947e489f739169773d7ca, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.TextMeshPro::TMPro.TMP_InputField
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 0}
m_TextViewport: {fileID: 0}
m_TextComponent: {fileID: 0}
m_Placeholder: {fileID: 0}
m_VerticalScrollbar: {fileID: 0}
m_VerticalScrollbarEventHandler: {fileID: 0}
m_LayoutGroup: {fileID: 0}
m_ScrollSensitivity: 1
m_ContentType: 0
m_InputType: 0
m_AsteriskChar: 42
m_KeyboardType: 0
m_LineType: 0
m_HideMobileInput: 0
m_HideSoftKeyboard: 0
m_CharacterValidation: 0
m_RegexValue:
m_GlobalPointSize: 14
m_CharacterLimit: 0
m_OnEndEdit:
m_PersistentCalls:
m_Calls: []
m_OnSubmit:
m_PersistentCalls:
m_Calls: []
m_OnSelect:
m_PersistentCalls:
m_Calls: []
m_OnDeselect:
m_PersistentCalls:
m_Calls: []
m_OnTextSelection:
m_PersistentCalls:
m_Calls: []
m_OnEndTextSelection:
m_PersistentCalls:
m_Calls: []
m_OnValueChanged:
m_PersistentCalls:
m_Calls: []
m_OnTouchScreenKeyboardStatusChanged:
m_PersistentCalls:
m_Calls: []
m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_CustomCaretColor: 0
m_SelectionColor: {r: 0.65882355, g: 0.80784315, b: 1, a: 0.7529412}
m_Text:
m_CaretBlinkRate: 0.85
m_CaretWidth: 1
m_ReadOnly: 0
m_RichText: 1
m_GlobalFontAsset: {fileID: 0}
m_OnFocusSelectAll: 1
m_ResetOnDeActivation: 1
m_KeepTextSelectionVisible: 0
m_RestoreOriginalTextOnEscape: 1
m_isRichTextEditingAllowed: 0
m_LineLimit: 0
isAlert: 0
m_InputValidator: {fileID: 0}
m_ShouldActivateOnSelect: 1
--- !u!4 &1944735672
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1944735669}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.21709, y: 0, z: 3.25431}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1967775146
GameObject:
m_ObjectHideFlags: 0
@@ -2252,3 +2398,4 @@ SceneRoots:
- {fileID: 1729948460}
- {fileID: 1276018793}
- {fileID: 1922038244}
- {fileID: 1944735672}

View File

@@ -396,7 +396,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.CanvasScaler
m_UiScaleMode: 0
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}

View File

@@ -0,0 +1,371 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 10
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 13
m_BakeOnSceneLoad: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 1
m_PVRFilteringGaussRadiusAO: 1
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0}
m_LightingSettings: {fileID: 0}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 3
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
buildHeightMesh: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &942839824
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 942839826}
- component: {fileID: 942839825}
m_Layer: 0
m_Name: FlappyBird
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &942839825
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 942839824}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 19096191e142d154e956c7169cca9a1e, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::FlappyBirdAllInOne
rb: {fileID: 0}
jumpForce: 5
isDead: 0
pipePrefab: {fileID: 0}
spawnPoint: {fileID: 0}
spawnRate: 2
heightOffset: 2
pipeSpeed: 2
scoreText: {fileID: 0}
gameOverPanel: {fileID: 0}
--- !u!4 &942839826
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 942839824}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.21709, y: 0, z: 3.25431}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1109769279
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1109769282}
- component: {fileID: 1109769281}
- component: {fileID: 1109769280}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &1109769280
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1109769279}
m_Enabled: 1
--- !u!20 &1109769281
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1109769279}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_Iso: 200
m_ShutterSpeed: 0.005
m_Aperture: 16
m_FocusDistance: 10
m_FocalLength: 50
m_BladeCount: 5
m_Curvature: {x: 2, y: 11}
m_BarrelClipping: 0.25
m_Anamorphism: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &1109769282
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1109769279}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1847134981
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1847134983}
- component: {fileID: 1847134982}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &1847134982
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1847134981}
m_Enabled: 1
serializedVersion: 11
m_Type: 1
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_UseViewFrustumForShadowCasterCull: 1
m_ForceVisible: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
m_LightUnit: 1
m_LuxAtDistance: 1
m_EnableSpotReflector: 1
--- !u!4 &1847134983
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1847134981}
serializedVersion: 2
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
m_Roots:
- {fileID: 1109769282}
- {fileID: 1847134983}
- {fileID: 942839826}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 58a0d1d70570e1340b7bde7edda96e9a
guid: 15742d157dfd1e42fb34ae90434eee41
DefaultImporter:
externalObjects: {}
userData:

View File

@@ -0,0 +1,316 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 10
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 13
m_BakeOnSceneLoad: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 1
m_PVRFilteringGaussRadiusAO: 1
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0}
m_LightingSettings: {fileID: 0}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 3
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
buildHeightMesh: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &1353791398
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1353791400}
- component: {fileID: 1353791399}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &1353791399
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1353791398}
m_Enabled: 1
serializedVersion: 11
m_Type: 1
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_UseViewFrustumForShadowCasterCull: 1
m_ForceVisible: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
m_LightUnit: 1
m_LuxAtDistance: 1
m_EnableSpotReflector: 1
--- !u!4 &1353791400
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1353791398}
serializedVersion: 2
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1 &1502660080
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1502660083}
- component: {fileID: 1502660082}
- component: {fileID: 1502660081}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &1502660081
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1502660080}
m_Enabled: 1
--- !u!20 &1502660082
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1502660080}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_Iso: 200
m_ShutterSpeed: 0.005
m_Aperture: 16
m_FocusDistance: 10
m_FocalLength: 50
m_BladeCount: 5
m_Curvature: {x: 2, y: 11}
m_BarrelClipping: 0.25
m_Anamorphism: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &1502660083
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1502660080}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
m_Roots:
- {fileID: 1502660083}
- {fileID: 1353791400}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 070c4a89027b6e9a28e16859d55f8c66
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,435 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 10
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 13
m_BakeOnSceneLoad: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 1
m_PVRFilteringGaussRadiusAO: 1
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0}
m_LightingSettings: {fileID: 0}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 3
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
buildHeightMesh: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &110756971
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 110756974}
- component: {fileID: 110756973}
- component: {fileID: 110756972}
m_Layer: 0
m_Name: ThrowInHole
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &110756972
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 110756971}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 071f79f81861c2741a92d8b044457d94, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::ObjectSpawner
objectPrefabs: []
holePrefab: {fileID: 0}
objectCount: 3
holeCount: 1
holesMove: 0
holeMoveSpeed: 2
minX: -3.5
maxX: 3.5
minY: -5
maxY: 4
objectParent: {fileID: 0}
holeParent: {fileID: 0}
--- !u!114 &110756973
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 110756971}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a819c02c3679b5a449b41052d2e6b3c9, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::LevelManager
itemsToScore: 3
OnAllItemsScored:
m_PersistentCalls:
m_Calls: []
--- !u!4 &110756974
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 110756971}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.21709, y: 0, z: 3.25431}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &131462842
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 131462844}
- component: {fileID: 131462843}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &131462843
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 131462842}
m_Enabled: 1
serializedVersion: 11
m_Type: 1
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_UseViewFrustumForShadowCasterCull: 1
m_ForceVisible: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
m_LightUnit: 1
m_LuxAtDistance: 1
m_EnableSpotReflector: 1
--- !u!4 &131462844
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 131462842}
serializedVersion: 2
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1 &168381609
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 168381612}
- component: {fileID: 168381611}
- component: {fileID: 168381610}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &168381610
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 168381609}
m_Enabled: 1
--- !u!20 &168381611
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 168381609}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_Iso: 200
m_ShutterSpeed: 0.005
m_Aperture: 16
m_FocusDistance: 10
m_FocalLength: 50
m_BladeCount: 5
m_Curvature: {x: 2, y: 11}
m_BarrelClipping: 0.25
m_Anamorphism: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &168381612
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 168381609}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1787410631
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1787410633}
- component: {fileID: 1787410632}
m_Layer: 0
m_Name: Satelit
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1787410632
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1787410631}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 375a1ddbfc192413b48906965449af87, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::SatelitTask
--- !u!4 &1787410633
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1787410631}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.21709, y: 0, z: 3.25431}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
m_Roots:
- {fileID: 168381612}
- {fileID: 131462844}
- {fileID: 110756974}
- {fileID: 1787410633}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: d34a25fb4e1abb111a62c1802c0477d4
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -38,12 +38,12 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.18028378, g: 0.22571412, b: 0.30692285, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 12
serializedVersion: 13
m_BakeOnSceneLoad: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
@@ -119,6 +119,100 @@ NavMeshSettings:
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &90211612
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 90211614}
- component: {fileID: 90211613}
m_Layer: 0
m_Name: GameManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &90211613
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 90211612}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 22bf82e679cf6e1419440d236360ba3b, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::GameManager
displayName: Hrac
firstMenuScene: main menu asi idk lol
buildingSettings:
ResidentialBuildingsMat: {fileID: 2100000, guid: d52b379b821c9ed624c15e9bd1420204, type: 2}
ResidentialBuildingHeight: 5
CommercialBuildingsMat: {fileID: 2100000, guid: cade7a38e47c1b875f65cda2cf3b77c5, type: 2}
CommercialBuildingHeight: 5
IndustrialBuildingsMat: {fileID: 2100000, guid: 4179f65aa390e873e96480f462d9fc3a, type: 2}
IndustrialBuildingHeight: 5
DefaultBuildingMat: {fileID: 2100000, guid: 1a50367e9d7460063dec2f85d18dde35, type: 2}
DefaultBuildingHeight: 5
pathwaySettings:
FootwayMat: {fileID: 2100000, guid: a40e1c43763bb5c9b97d7999ac3c6f9d, type: 2}
FootwayWidth: 2
PathMat: {fileID: 2100000, guid: b8c268a7008ed5031da152380545235d, type: 2}
PathWidth: 2
StepsMat: {fileID: 2100000, guid: b8c268a7008ed5031da152380545235d, type: 2}
StepsWidth: 2
CyclewayMat: {fileID: 2100000, guid: 9ecf5df4890c0486002bf43baf684bab, type: 2}
CyclewayWidth: 2
PedestrianMat: {fileID: 2100000, guid: b8c268a7008ed5031da152380545235d, type: 2}
PedestrianWidth: 2
RoadMat: {fileID: 2100000, guid: f831020d62c88ea9dfde83f98d539f55, type: 2}
RoadWidth: 2
ServiceMat: {fileID: 2100000, guid: f831020d62c88ea9dfde83f98d539f55, type: 2}
ServiceWidth: 2
ResidentialMat: {fileID: 2100000, guid: d52b379b821c9ed624c15e9bd1420204, type: 2}
ResidentialWidth: 2
TrackMat: {fileID: 2100000, guid: b8c268a7008ed5031da152380545235d, type: 2}
TrackWidth: 2
DefaultMat: {fileID: 2100000, guid: 57c69638d7afff039a48123e7b4ade7b, type: 2}
DefaultWidth: 2
areaSettings:
ParkMat: {fileID: 2100000, guid: 77b772132676975a3462e3aca2cfac0c, type: 2}
GardenMat: {fileID: 2100000, guid: 77b772132676975a3462e3aca2cfac0c, type: 2}
PlaygroundMat: {fileID: 2100000, guid: 77b772132676975a3462e3aca2cfac0c, type: 2}
ForestMat: {fileID: 2100000, guid: ef4ea3212671d276649ca366ed6e7f0c, type: 2}
GrassMat: {fileID: 2100000, guid: 77b772132676975a3462e3aca2cfac0c, type: 2}
WaterMat: {fileID: 2100000, guid: eff7cc5b4e29f7918320d3979c3d0cb1, type: 2}
DefaultMat: {fileID: 2100000, guid: 57c69638d7afff039a48123e7b4ade7b, type: 2}
pendingRadius: 500
pendingImpostorCount: 1
pendingTaskCount: 5
minigameScenes:
- MiniGame-Kabely V10
- MiniGame-insertkeys
- MiniGame-FlappyBird
- MiniGame-ThrowInHole
- MiniGame-Satelit
testMode: 0
--- !u!4 &90211614
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 90211612}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.21709, y: 0, z: 3.25431}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &330585543
GameObject:
m_ObjectHideFlags: 0
@@ -224,38 +318,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_RenderShadows: 1
m_RequiresDepthTextureOption: 2
m_RequiresOpaqueTextureOption: 2
m_CameraType: 0
m_Cameras: []
m_RendererIndex: -1
m_VolumeLayerMask:
serializedVersion: 2
m_Bits: 1
m_VolumeTrigger: {fileID: 0}
m_VolumeFrameworkUpdateModeOption: 2
m_RenderPostProcessing: 1
m_Antialiasing: 0
m_AntialiasingQuality: 2
m_StopNaN: 0
m_Dithering: 0
m_ClearDepth: 1
m_AllowXRRendering: 1
m_AllowHDROutput: 1
m_UseScreenCoordOverride: 0
m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0}
m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0}
m_RequiresDepthTexture: 0
m_RequiresColorTexture: 0
m_Version: 2
m_TaaSettings:
quality: 3
frameInfluence: 0.1
jitterScale: 1
mipBias: 0
varianceClampScale: 0.9
contrastAdaptiveSharpening: 0
--- !u!1 &410087039
GameObject:
m_ObjectHideFlags: 0
@@ -336,6 +398,9 @@ Light:
m_ForceVisible: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
m_LightUnit: 1
m_LuxAtDistance: 1
m_EnableSpotReflector: 1
--- !u!4 &410087041
Transform:
m_ObjectHideFlags: 0
@@ -363,17 +428,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Version: 3
m_UsePipelineSettings: 1
m_AdditionalLightsShadowResolutionTier: 2
m_LightLayerMask: 1
m_RenderingLayers: 1
m_CustomShadowLayers: 0
m_ShadowLayerMask: 1
m_ShadowRenderingLayers: 1
m_LightCookieSize: {x: 1, y: 1}
m_LightCookieOffset: {x: 0, y: 0}
m_SoftShadowQuality: 1
--- !u!1 &832575517
GameObject:
m_ObjectHideFlags: 0
@@ -403,11 +457,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IsGlobal: 1
priority: 0
blendDistance: 0
weight: 1
sharedProfile: {fileID: 11400000, guid: 10fc4df2da32a41aaa32d77bc913491c, type: 2}
--- !u!4 &832575519
Transform:
m_ObjectHideFlags: 0
@@ -430,3 +479,4 @@ SceneRoots:
- {fileID: 330585546}
- {fileID: 410087041}
- {fileID: 832575519}
- {fileID: 90211614}

View File

@@ -830,7 +830,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.CanvasScaler
m_UiScaleMode: 0
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 1600, y: 900}

View File

@@ -0,0 +1,49 @@
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
/// <summary>
/// Attach to a manager GameObject in "are u sure.unity".
/// "yes" = confirm leave lobby and go to main menu.
/// "no" = go back to previous lobby scene.
/// </summary>
public class ConfirmLeaveUI : MonoBehaviour
{
[Header("Optional refs (auto-found by name if null)")]
public Button yesButton;
public Button noButton;
[Tooltip("Scene to load after leaving lobby")]
public string mainMenuScene = "main menu asi idk lol";
[Tooltip("Scene to go back to when player presses No")]
public string previousScene = "create";
void Start()
{
if (yesButton == null)
{
var go = GameObject.Find("yes");
if (go != null) yesButton = go.GetComponent<Button>();
}
if (noButton == null)
{
var go = GameObject.Find("no");
if (go != null) noButton = go.GetComponent<Button>();
}
if (yesButton != null) yesButton.onClick.AddListener(OnYesClicked);
if (noButton != null) noButton.onClick.AddListener(OnNoClicked);
}
private void OnYesClicked()
{
GameManager.Instance?.LeaveLobbyButton();
SceneManager.LoadScene(mainMenuScene, LoadSceneMode.Single);
}
private void OnNoClicked()
{
SceneManager.LoadScene(previousScene, LoadSceneMode.Single);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: cef2287cbad97c8b8a4451dfb6a8e472
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,68 +0,0 @@
using System.Collections;
using UnityEngine;
public class GPSManager : MonoBehaviour
{
[Header("GPS settings")]
public float Accuracy = 10f;
public float UpdateDistance = 5f;
public int MaxWait = 20;
[Header("GPS coordinates")]
private double[] LastCoords = new double[2];
private double[] FailsafeCoords = new double[] { 50.7727878, 15.0718625 };
private double? LastTime;
void Start()
{
StartCoroutine(UpdateGPS());
}
public double[] GetLastCoords()
{
if (LastCoords[0] == 0 && LastCoords[1] == 0) { return FailsafeCoords; }
return LastCoords;
}
IEnumerator UpdateGPS()
{
if (!Input.location.isEnabledByUser)
{
Debug.Log("GPS not enabled by user");
LastCoords = FailsafeCoords;
LastTime = null;
yield break;
}
Input.location.Start(Accuracy, UpdateDistance);
while (Input.location.status == LocationServiceStatus.Initializing && MaxWait > 0)
{
yield return new WaitForSeconds(1);
MaxWait--;
}
if (MaxWait < 1)
{
Debug.Log("GPS timed out");
LastCoords = FailsafeCoords;
LastTime = null;
yield break;
}
if (Input.location.status == LocationServiceStatus.Failed)
{
Debug.Log("GPS failed to determine device location");
LastCoords = FailsafeCoords;
LastTime = null;
yield break;
}
else
{
LastCoords[0] = Input.location.lastData.latitude;
LastCoords[1] = Input.location.lastData.longitude;
LastTime = Input.location.lastData.timestamp;
Debug.Log("GPS location: " + LastCoords[0] + ", " + LastCoords[1] + " (time: " + LastTime + ")");
}
yield return StartCoroutine(UpdateGPS());
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 9f23d4bd550984f49b2c2a8bcbe09106

View File

@@ -0,0 +1,65 @@
using UnityEngine;
using UnityEngine.UI;
using TMPro;
/// <summary>
/// Attach to a manager GameObject in host lobby.unity.
/// Reads radius from the "radius" slider/input and triggers CreateLobby.
/// Also wires the "vytvořit" button.
/// </summary>
public class HostLobbyUI : MonoBehaviour
{
[Header("Optional refs (auto-found by name if null)")]
public Slider radiusSlider;
public TMP_InputField radiusInput;
public Button createButton;
void Start()
{
if (radiusSlider == null)
{
var go = GameObject.Find("radius");
if (go != null) radiusSlider = go.GetComponent<Slider>();
}
if (radiusInput == null)
{
var go = GameObject.Find("radius");
if (go != null) radiusInput = go.GetComponent<TMP_InputField>();
}
if (createButton == null)
{
// Try all name variants used by the Art team
var go = GameObject.Find("stvo\u0159it") // stvořit
?? GameObject.Find("stvorit")
?? GameObject.Find("vytvo\u0159it") // vytvořit
?? GameObject.Find("vytvorit");
if (go != null)
{
createButton = go.GetComponent<Button>();
// Disable the Art team's direct scene-changer so only our
// wired OnCreateClicked fires (navigation is handled by
// HandleCreateLobbyResponse after the server confirms).
var sceneChanger = go.GetComponent<CudlikZmenaSceny>();
if (sceneChanger != null) sceneChanger.enabled = false;
}
}
if (createButton != null)
createButton.onClick.AddListener(OnCreateClicked);
}
private void OnCreateClicked()
{
var gm = GameManager.Instance;
if (gm == null) return;
// Read radius from slider or input field
if (radiusSlider != null)
gm.pendingRadius = radiusSlider.value;
else if (radiusInput != null && float.TryParse(radiusInput.text, out float r))
gm.pendingRadius = r;
gm.CreateLobbyButton();
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 60a81c1cb4f98a5b490fac0d3c1686b5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,318 @@
using UnityEngine;
using UnityEngine.UI;
using TMPro;
/// <summary>
/// Programmatically builds the complete in-game HUD inside the InGame canvas (Client.unity).
///
/// Call BuildNow() explicitly from GameManager.OnSceneLoaded BEFORE BindClientScene(),
/// so that GameManager_UI can find the newly created elements by name.
///
/// Named GameObjects created as direct children of InGame canvas (required by Transform.Find):
/// • ActionButton — Button + TMP child; shown/hidden by GameManager_Tasks.UpdateProximity()
/// • SabotagePanel — warning banner at top (contains "SabotageTimer" TMP_Text)
/// • MeetingPanel — voting/meeting overlay (populated by GameManager_UI.ShowMeetingPanel)
/// • GameEndPanel — end-of-game overlay (contains "GameEndText" TMP_Text)
///
/// Named TMP_Text descendants (found by GameManager_UI.FindTMP — any depth):
/// • KillCooldown — shown to impostors during kill cooldown
/// • TaskList — crewmate task names
/// • TaskProgress — global task completion "X/Y tasks"
/// • SabotageTimer — countdown inside SabotagePanel
/// • GameEndText — win/lose result text inside GameEndPanel
/// • (Role already exists in the scene)
///
/// Additional elements managed by this script:
/// • RecenterBtn — calls MapCameraController.Instance.Recenter()
/// </summary>
public class InGameHUDBuilder : MonoBehaviour
{
// ── Color palette ─────────────────────────────────────────────────────────
private static readonly Color C_BG = new Color(0.05f, 0.06f, 0.12f, 0.80f);
private static readonly Color C_BAR_BG = new Color(0.03f, 0.04f, 0.08f, 0.90f);
private static readonly Color C_ACCENT = new Color(0.20f, 0.60f, 1.00f, 1.00f);
private static readonly Color C_GREEN = new Color(0.18f, 0.75f, 0.30f, 1.00f);
private static readonly Color C_RED = new Color(0.76f, 0.19f, 0.19f, 1.00f);
private static readonly Color C_ORANGE = new Color(0.95f, 0.55f, 0.10f, 1.00f);
private bool _built;
// ── Entry points ──────────────────────────────────────────────────────────
/// <summary>Called from GameManager.OnSceneLoaded before BindClientScene.</summary>
public void BuildNow()
{
if (_built) return;
_built = true;
Build();
}
void Start()
{
if (!_built) Build(); // safety fallback
}
// ── Build ─────────────────────────────────────────────────────────────────
void Build()
{
var rt = GetComponent<RectTransform>();
if (rt == null) return;
// ── Top bar: role is already in scene, add kill-cooldown ─────────────
BuildTopBar(rt);
// ── Right task panel ──────────────────────────────────────────────────
BuildTaskPanel(rt);
// ── Task progress (above bottom bar) ─────────────────────────────────
BuildTaskProgress(rt);
// ── Bottom bar: action button + recenter ──────────────────────────────
BuildBottomBar(rt);
// ── Action button (DIRECT child — Transform.Find requirement) ─────────
BuildActionButton(rt);
// ── Sabotage panel (DIRECT child) ─────────────────────────────────────
BuildSabotagePanel(rt);
// ── Meeting panel (DIRECT child) ──────────────────────────────────────
BuildMeetingPanel(rt);
// ── Game-end panel (DIRECT child) ─────────────────────────────────────
BuildGameEndPanel(rt);
}
// ── Section builders ──────────────────────────────────────────────────────
void BuildTopBar(RectTransform parent)
{
// Thin semi-transparent header at very top
var bar = AddChild("_TopBar", parent);
Anchor(bar, new Vector2(0f, 1f), new Vector2(1f, 1f));
bar.sizeDelta = new Vector2(0f, 90f);
bar.anchoredPosition = new Vector2(0f, 0f);
bar.pivot = new Vector2(0.5f, 1f);
AddImage(bar.gameObject, C_BAR_BG);
// Kill cooldown (right side) — starts hidden
var cd = AddChild("KillCooldown", bar);
Anchor(cd, new Vector2(0.5f, 0f), new Vector2(1f, 1f));
cd.offsetMin = new Vector2(0f, 6f);
cd.offsetMax = new Vector2(-12f, -6f);
var cdTmp = cd.gameObject.AddComponent<TextMeshProUGUI>();
cdTmp.text = "";
cdTmp.fontSize = 32;
cdTmp.color = C_ORANGE;
cdTmp.fontStyle = FontStyles.Bold;
cdTmp.alignment = TextAlignmentOptions.MidlineRight;
cd.gameObject.SetActive(false);
}
void BuildTaskPanel(RectTransform parent)
{
// Right-side floating panel (always visible during game)
var panel = AddChild("_TaskPanel", parent);
Anchor(panel, new Vector2(1f, 0.35f), new Vector2(1f, 0.88f));
panel.pivot = new Vector2(1f, 0.5f);
panel.sizeDelta = new Vector2(280f, 0f);
panel.anchoredPosition = Vector2.zero;
AddImage(panel.gameObject, C_BG);
// "MY TASKS" header
var hdr = AddChild("_Header", panel);
Anchor(hdr, new Vector2(0f, 1f), new Vector2(1f, 1f));
hdr.pivot = new Vector2(0.5f, 1f);
hdr.sizeDelta = new Vector2(0f, 44f);
hdr.anchoredPosition = Vector2.zero;
AddImage(hdr.gameObject, C_ACCENT * new Color(1, 1, 1, 0.6f));
var hdrTmp = AddTextChild(hdr, "_HeaderTxt", "MY TASKS", 26, FontStyles.Bold, TextAlignmentOptions.Center);
hdrTmp.color = Color.white;
// Task list body
var body = AddChild("TaskList", panel);
Anchor(body, new Vector2(0f, 0f), new Vector2(1f, 1f));
body.offsetMin = new Vector2(8f, 8f);
body.offsetMax = new Vector2(-8f, -48f);
var taskTmp = body.gameObject.AddComponent<TextMeshProUGUI>();
taskTmp.text = "";
taskTmp.fontSize = 22;
taskTmp.color = Color.white;
taskTmp.alignment = TextAlignmentOptions.TopLeft;
}
void BuildTaskProgress(RectTransform parent)
{
var prog = AddChild("TaskProgress", parent);
Anchor(prog, new Vector2(0f, 0f), new Vector2(1f, 0f));
prog.pivot = new Vector2(0.5f, 0f);
prog.sizeDelta = new Vector2(-20f, 40f);
prog.anchoredPosition = new Vector2(0f, 120f); // above bottom bar
var tmp = prog.gameObject.AddComponent<TextMeshProUGUI>();
tmp.text = "";
tmp.fontSize = 28;
tmp.color = Color.white;
tmp.fontStyle = FontStyles.Bold;
tmp.alignment = TextAlignmentOptions.Center;
}
void BuildBottomBar(RectTransform parent)
{
var bar = AddChild("_BottomBar", parent);
Anchor(bar, new Vector2(0f, 0f), new Vector2(1f, 0f));
bar.pivot = new Vector2(0.5f, 0f);
bar.sizeDelta = new Vector2(0f, 110f);
bar.anchoredPosition = Vector2.zero;
AddImage(bar.gameObject, C_BAR_BG);
// Recenter button (bottom-right of bar)
var recBtn = AddChild("_RecenterBtn", bar);
Anchor(recBtn, new Vector2(0.82f, 0.08f), new Vector2(0.98f, 0.92f));
var recBg = AddImage(recBtn.gameObject, C_ACCENT);
var recButton = recBtn.gameObject.AddComponent<Button>();
var recColors = recButton.colors;
recColors.pressedColor = new Color(0.1f, 0.4f, 0.8f);
recButton.colors = recColors;
recButton.targetGraphic = recBg;
recButton.onClick.AddListener(() => MapCameraController.Instance?.Recenter());
var recTxt = AddTextChild(recBtn, "_RecTxt", "⊙", 42, FontStyles.Bold, TextAlignmentOptions.Center);
recTxt.color = Color.white;
}
void BuildActionButton(RectTransform parent)
{
// MUST be a DIRECT child so Transform.Find("ActionButton") works
var btn = AddChild("ActionButton", parent);
Anchor(btn, new Vector2(0.15f, 0f), new Vector2(0.80f, 0f));
btn.pivot = new Vector2(0.5f, 0f);
btn.sizeDelta = new Vector2(0f, 90f);
btn.anchoredPosition = new Vector2(0f, 12f);
var bg = AddImage(btn.gameObject, C_GREEN);
var button = btn.gameObject.AddComponent<Button>();
var colors = button.colors;
colors.normalColor = C_GREEN;
colors.pressedColor = new Color(0.12f, 0.55f, 0.22f);
button.colors = colors;
button.targetGraphic = bg;
// TMP child named "Text" so GetComponentInChildren<TMP_Text> finds it
var txtRt = AddChild("Text", btn);
Stretch(txtRt);
var tmp = txtRt.gameObject.AddComponent<TextMeshProUGUI>();
tmp.text = "ACTION";
tmp.fontSize = 44;
tmp.fontStyle = FontStyles.Bold;
tmp.color = Color.white;
tmp.alignment = TextAlignmentOptions.Center;
btn.gameObject.SetActive(false); // hidden until proximity detected
}
void BuildSabotagePanel(RectTransform parent)
{
// DIRECT child
var panel = AddChild("SabotagePanel", parent);
Anchor(panel, new Vector2(0f, 0.88f), new Vector2(1f, 1f));
panel.offsetMin = new Vector2(0f, -10f);
panel.offsetMax = new Vector2(0f, -80f);
AddImage(panel.gameObject, C_RED * new Color(1, 1, 1, 0.88f));
var timer = AddChild("SabotageTimer", panel);
Stretch(timer);
var tmp = timer.gameObject.AddComponent<TextMeshProUGUI>();
tmp.text = "SABOTAGE!";
tmp.fontSize = 48;
tmp.fontStyle = FontStyles.Bold;
tmp.color = Color.white;
tmp.alignment = TextAlignmentOptions.Center;
panel.gameObject.SetActive(false);
}
void BuildMeetingPanel(RectTransform parent)
{
// DIRECT child — populated by GameManager_UI.ShowMeetingPanel at runtime
var panel = AddChild("MeetingPanel", parent);
Anchor(panel, new Vector2(0.05f, 0.10f), new Vector2(0.95f, 0.90f));
AddImage(panel.gameObject, new Color(0.04f, 0.05f, 0.14f, 0.96f));
var title = AddChild("_MeetingTitle", panel);
Anchor(title, new Vector2(0f, 0.85f), new Vector2(1f, 1f));
var titleTmp = title.gameObject.AddComponent<TextMeshProUGUI>();
titleTmp.text = "EMERGENCY MEETING";
titleTmp.fontSize = 44;
titleTmp.fontStyle = FontStyles.Bold;
titleTmp.color = C_ORANGE;
titleTmp.alignment = TextAlignmentOptions.Center;
panel.gameObject.SetActive(false);
}
void BuildGameEndPanel(RectTransform parent)
{
// DIRECT child, full-screen overlay
var panel = AddChild("GameEndPanel", parent);
Stretch(panel);
AddImage(panel.gameObject, new Color(0f, 0f, 0f, 0.85f));
var txt = AddChild("GameEndText", panel);
Stretch(txt);
var tmp = txt.gameObject.AddComponent<TextMeshProUGUI>();
tmp.text = "";
tmp.fontSize = 72;
tmp.fontStyle = FontStyles.Bold;
tmp.color = Color.white;
tmp.alignment = TextAlignmentOptions.Center;
panel.gameObject.SetActive(false);
}
// ── Helpers ───────────────────────────────────────────────────────────────
RectTransform AddChild(string name, RectTransform parent)
{
var go = new GameObject(name);
var rt = go.AddComponent<RectTransform>();
rt.SetParent(parent, false);
rt.localScale = Vector3.one;
return rt;
}
Image AddImage(GameObject go, Color color)
{
var img = go.AddComponent<Image>();
img.color = color;
return img;
}
TextMeshProUGUI AddTextChild(RectTransform parent, string name, string text,
float size, FontStyles style, TextAlignmentOptions align)
{
var rt = AddChild(name, parent);
Stretch(rt);
var tmp = rt.gameObject.AddComponent<TextMeshProUGUI>();
tmp.text = text;
tmp.fontSize = size;
tmp.fontStyle = style;
tmp.alignment = align;
tmp.color = Color.white;
return tmp;
}
void Anchor(RectTransform rt, Vector2 min, Vector2 max)
{
rt.anchorMin = min;
rt.anchorMax = max;
rt.offsetMin = Vector2.zero;
rt.offsetMax = Vector2.zero;
}
void Stretch(RectTransform rt)
{
rt.anchorMin = Vector2.zero;
rt.anchorMax = Vector2.one;
rt.offsetMin = Vector2.zero;
rt.offsetMax = Vector2.zero;
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: f269d8f8742088e5fbad88cd1d352180

View File

@@ -0,0 +1,147 @@
using UnityEngine;
using UnityEngine.UI;
using TMPro;
/// <summary>
/// Attach to any manager GO in join lobby.unity.
/// Converts the "code" button GO into a working TMP_InputField at runtime
/// and wires the join button to call GameManager.JoinLobbyButton().
/// </summary>
public class JoinLobbyUI : MonoBehaviour
{
private TMP_InputField _codeInput;
private TMP_Text _errorText;
void Start()
{
// ── Build proper code input from the "code" Button GO ─────────────────
var codeGO = GameObject.Find("code");
if (codeGO != null)
{
var rt = codeGO.GetComponent<RectTransform>();
if (rt != null)
{
// Remove Button — it swallows click events before input field can act
var btn = codeGO.GetComponent<Button>();
if (btn != null) DestroyImmediate(btn);
var oldField = codeGO.GetComponent<TMP_InputField>();
if (oldField != null) DestroyImmediate(oldField);
// Clear art-team child text labels
var kill = new System.Collections.Generic.List<GameObject>();
foreach (Transform child in rt) kill.Add(child.gameObject);
foreach (var go in kill) DestroyImmediate(go);
// Background
var img = codeGO.GetComponent<Image>();
if (img == null) img = codeGO.AddComponent<Image>();
img.color = new Color(0.08f, 0.10f, 0.20f, 0.92f);
// Viewport > Placeholder + Text
var vpRT = MakeChild("Text Area", rt);
vpRT.anchorMin = Vector2.zero;
vpRT.anchorMax = Vector2.one;
vpRT.offsetMin = new Vector2(18f, 6f);
vpRT.offsetMax = new Vector2(-18f, -6f);
vpRT.gameObject.AddComponent<RectMask2D>();
var phRT = MakeChild("Placeholder", vpRT);
Stretch(phRT);
var ph = phRT.gameObject.AddComponent<TextMeshProUGUI>();
ph.text = "Enter lobby code...";
ph.fontSize = 48;
ph.color = new Color(0.55f, 0.60f, 0.70f, 0.85f);
ph.fontStyle = FontStyles.Italic;
ph.alignment = TextAlignmentOptions.Center;
var txtRT = MakeChild("Text", vpRT);
Stretch(txtRT);
var txt = txtRT.gameObject.AddComponent<TextMeshProUGUI>();
txt.text = "";
txt.fontSize = 52;
txt.color = Color.white;
txt.fontStyle = FontStyles.Bold;
txt.alignment = TextAlignmentOptions.Center;
txt.characterSpacing = 8f;
_codeInput = codeGO.AddComponent<TMP_InputField>();
_codeInput.textViewport = vpRT;
_codeInput.textComponent = txt;
_codeInput.placeholder = ph;
_codeInput.targetGraphic = img;
_codeInput.characterLimit = 8;
_codeInput.characterValidation = TMP_InputField.CharacterValidation.Alphanumeric;
_codeInput.keyboardType = TouchScreenKeyboardType.Default;
_codeInput.shouldHideMobileInput = false;
// Auto-uppercase as user types
_codeInput.onValueChanged.AddListener(v =>
_codeInput.SetTextWithoutNotify(v.ToUpperInvariant()));
}
}
// ── Wire the join button ───────────────────────────────────────────────
// Art team named the button "připojit" with literal quote marks in the name
var joinBtnGO = FindGOByNameContains("ipojit");
if (joinBtnGO != null)
{
var joinBtn = joinBtnGO.GetComponent<Button>();
if (joinBtn == null) joinBtn = joinBtnGO.AddComponent<Button>();
joinBtn.onClick.AddListener(OnJoinClicked);
}
// ── Error label (optional) ─────────────────────────────────────────────
var errGO = GameObject.Find("error") ?? GameObject.Find("ErrorText");
if (errGO != null)
{
_errorText = errGO.GetComponent<TMP_Text>();
if (_errorText != null) _errorText.gameObject.SetActive(false);
}
}
void OnJoinClicked()
{
var gm = GameManager.Instance;
if (gm == null) return;
string code = _codeInput != null ? _codeInput.text.Trim() : "";
if (string.IsNullOrEmpty(code))
{
ShowError("Enter a lobby code!");
return;
}
if (_errorText != null) _errorText.gameObject.SetActive(false);
gm.JoinLobbyButton(code);
}
void ShowError(string msg)
{
if (_errorText == null) return;
_errorText.text = msg;
_errorText.gameObject.SetActive(true);
}
// Finds a GO whose name contains the substring (handles Art-team quoted names)
GameObject FindGOByNameContains(string substring)
{
foreach (var go in FindObjectsOfType<GameObject>())
if (go.name.Contains(substring)) return go;
return null;
}
RectTransform MakeChild(string name, RectTransform parent)
{
var go = new GameObject(name);
var rt = go.AddComponent<RectTransform>();
rt.SetParent(parent, false);
rt.localScale = Vector3.one;
return rt;
}
void Stretch(RectTransform rt)
{
rt.anchorMin = Vector2.zero;
rt.anchorMax = Vector2.one;
rt.offsetMin = rt.offsetMax = Vector2.zero;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0e0ca5d57a20e05215c36664ab8ff60e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,417 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
using GeoSus.Client;
/// <summary>
/// Attach to any manager GameObject in create.unity or join loading.unity.
/// On Start(), removes all placeholder Art elements from the Canvas and builds
/// a proper mobile-portrait lobby screen entirely in code.
/// </summary>
public class LobbyDisplayUI : MonoBehaviour
{
// ── Static hub so GameManager_UI can push state updates ──────────────────
private static readonly HashSet<LobbyDisplayUI> _all = new HashSet<LobbyDisplayUI>();
public static void RefreshAll(LobbyState state)
{
foreach (var ui in _all) ui._pending = state;
}
// ── Built UI references ───────────────────────────────────────────────────
private TMP_Text _codeText;
private TMP_Text _countText;
private Transform _listContent;
private TMP_Text _statusText;
private GameObject _startFooter;
private GameObject _waitFooter;
private readonly List<GameObject> _rows = new List<GameObject>();
private LobbyState _pending;
// ── Colour palette ────────────────────────────────────────────────────────
static Color H(string hex) { ColorUtility.TryParseHtmlString(hex, out var c); return c; }
static readonly Color C_BG = H("#0D0F1A");
static readonly Color C_HDR = H("#141927");
static readonly Color C_SUBBG = H("#0F1221");
static readonly Color C_ROW_A = H("#1A2035");
static readonly Color C_ROW_B = H("#161C2E");
static readonly Color C_DIVIDER = H("#252A3F");
static readonly Color C_ACCENT = H("#3399FF");
static readonly Color C_GOLD = H("#FFB800");
static readonly Color C_GREEN = H("#2DB84B");
static readonly Color C_RED = H("#C43232");
static readonly Color C_MUTED = new Color(0.47f, 0.53f, 0.67f);
static readonly Color C_WHITE = Color.white;
static readonly Color C_SOFT = new Color(0.73f, 0.80f, 0.88f);
void OnEnable() => _all.Add(this);
void OnDisable() => _all.Remove(this);
// ── Lifecycle ─────────────────────────────────────────────────────────────
void Start()
{
var canvasGO = GameObject.Find("Canvas");
if (canvasGO == null)
{
Debug.LogError("[LobbyDisplayUI] No Canvas found in scene!");
return;
}
// Remove all placeholder Art children immediately (before we build)
var kill = new List<GameObject>();
foreach (Transform child in canvasGO.transform)
kill.Add(child.gameObject);
foreach (var go in kill)
DestroyImmediate(go);
Build(canvasGO.transform);
}
void Update()
{
var gm = GameManager.Instance;
if (gm?.gameClient?.CurrentLobbyState != null)
_pending = gm.gameClient.CurrentLobbyState;
if (_pending != null && _listContent != null)
{
Refresh(_pending);
_pending = null;
}
}
// ── Full UI construction ──────────────────────────────────────────────────
void Build(Transform canvasRoot)
{
const float HDR_H = 250f;
const float SUB_H = 88f;
const float FOOT_H = 180f;
const float BTN_W = 200f;
// Fullscreen dark overlay
var root = RT("Root", canvasRoot);
Stretch(root);
Img(root, C_BG);
// ─── Header bar ───────────────────────────────────────────────────────
var header = RT("Header", root);
PinTop(header, HDR_H);
Img(header, C_HDR);
// Back (✕) button — left side of header
var backBtn = RT("BackBtn", header);
backBtn.anchorMin = new Vector2(0f, 0f);
backBtn.anchorMax = new Vector2(0f, 1f);
backBtn.pivot = new Vector2(0f, 0.5f);
backBtn.offsetMin = new Vector2(18f, 22f);
backBtn.offsetMax = new Vector2(BTN_W + 18f, -22f);
Img(backBtn, C_RED);
Btn(backBtn, C_RED, () => GameManager.Instance?.LeaveLobbyButton());
TxtChild(backBtn, "✕", 72, C_WHITE, TextAlignmentOptions.Center, bold: true);
// "LOBBY CODE" micro label — upper-center of header
var codeLbl = RT("CodeLbl", header);
codeLbl.anchorMin = new Vector2(0.14f, 0.52f);
codeLbl.anchorMax = new Vector2(0.86f, 0.97f);
codeLbl.offsetMin = codeLbl.offsetMax = Vector2.zero;
TmpDirect(codeLbl, "LOBBY CODE", 28, C_MUTED, TextAlignmentOptions.Center, bold: true);
// Large code value — lower-center of header
var codeValRT = RT("CodeVal", header);
codeValRT.anchorMin = new Vector2(0.14f, 0.05f);
codeValRT.anchorMax = new Vector2(0.86f, 0.52f);
codeValRT.offsetMin = codeValRT.offsetMax = Vector2.zero;
_codeText = TmpDirect(codeValRT, "------", 76, C_ACCENT, TextAlignmentOptions.Center, bold: true);
// Copy (⎘) button — right side of header
var copyBtn = RT("CopyBtn", header);
copyBtn.anchorMin = new Vector2(1f, 0f);
copyBtn.anchorMax = new Vector2(1f, 1f);
copyBtn.pivot = new Vector2(1f, 0.5f);
copyBtn.offsetMin = new Vector2(-(BTN_W + 18f), 22f);
copyBtn.offsetMax = new Vector2(-18f, -22f);
Img(copyBtn, C_ACCENT);
Btn(copyBtn, C_ACCENT, () =>
{
if (_codeText != null) GUIUtility.systemCopyBuffer = _codeText.text;
});
TxtChild(copyBtn, "⎘", 60, C_WHITE, TextAlignmentOptions.Center);
// ─── Player count subtitle bar ─────────────────────────────────────────
var subBar = RT("CountBar", root);
PinBelowTop(subBar, HDR_H, SUB_H);
Img(subBar, C_SUBBG);
_countText = TxtChild(subBar, "0 players in lobby", 34, C_MUTED, TextAlignmentOptions.Center);
// ─── Scrollable player list ────────────────────────────────────────────
var scrollArea = RT("PlayerScroll", root);
Fill(scrollArea, HDR_H + SUB_H, FOOT_H);
BuildScroll(scrollArea);
// ─── Footer: START GAME (host) or waiting text (others) ───────────────
_startFooter = new GameObject("StartFooter");
var sfRT = _startFooter.AddComponent<RectTransform>();
sfRT.SetParent(root, false);
sfRT.localScale = Vector3.one;
PinBottom(sfRT, FOOT_H);
Img(sfRT, C_SUBBG);
var startBtnRT = RT("StartBtn", sfRT);
Fill(startBtnRT, 20f, 20f, 24f, 24f);
Img(startBtnRT, C_GREEN);
Btn(startBtnRT, C_GREEN, () => GameManager.Instance?.StartGameButton());
TxtChild(startBtnRT, "▶ START GAME", 54, C_WHITE, TextAlignmentOptions.Center, bold: true);
_startFooter.SetActive(false);
_waitFooter = new GameObject("WaitFooter");
var wfRT = _waitFooter.AddComponent<RectTransform>();
wfRT.SetParent(root, false);
wfRT.localScale = Vector3.one;
PinBottom(wfRT, FOOT_H);
Img(wfRT, C_SUBBG);
_statusText = TxtChild(wfRT, "⌛ Waiting for host to start...", 38, C_MUTED,
TextAlignmentOptions.Center, italic: true);
_waitFooter.SetActive(true);
}
void BuildScroll(RectTransform rt)
{
var sr = rt.gameObject.AddComponent<ScrollRect>();
var viewport = RT("Viewport", rt);
Stretch(viewport);
viewport.gameObject.AddComponent<RectMask2D>();
var content = RT("Content", viewport);
content.anchorMin = new Vector2(0f, 1f);
content.anchorMax = new Vector2(1f, 1f);
content.pivot = new Vector2(0.5f, 1f);
content.sizeDelta = new Vector2(0f, 0f);
content.anchoredPosition = Vector2.zero;
var vlg = content.gameObject.AddComponent<VerticalLayoutGroup>();
vlg.childControlWidth = true;
vlg.childControlHeight = false;
vlg.childForceExpandWidth = true;
vlg.childForceExpandHeight = false;
vlg.spacing = 2f;
vlg.padding = new RectOffset(0, 0, 0, 0);
var csf = content.gameObject.AddComponent<ContentSizeFitter>();
csf.verticalFit = ContentSizeFitter.FitMode.PreferredSize;
sr.viewport = viewport;
sr.content = content;
sr.horizontal = false;
sr.vertical = true;
sr.scrollSensitivity = 80f;
sr.movementType = ScrollRect.MovementType.Elastic;
sr.elasticity = 0.1f;
_listContent = content;
}
// ── State refresh ─────────────────────────────────────────────────────────
void Refresh(LobbyState state)
{
if (_codeText != null) _codeText.text = state.JoinCode ?? "------";
int n = state.Players.Count;
if (_countText != null)
_countText.text = $"{n} player{(n == 1 ? "" : "s")} in lobby";
var gm = GameManager.Instance;
bool isHost = gm?.gameClient?.IsOwner ?? false;
string myId = gm?.gameClient?.ClientUuid ?? "";
if (_startFooter != null) _startFooter.SetActive(isHost);
if (_waitFooter != null) _waitFooter.SetActive(!isHost);
if (_statusText != null)
_statusText.text = state.Phase == GamePhase.Loading
? "⏳ Downloading map data..."
: "⌛ Waiting for host to start...";
if (_listContent == null) return;
foreach (var row in _rows) Destroy(row);
_rows.Clear();
for (int i = 0; i < state.Players.Count; i++)
{
var p = state.Players[i];
bool me = p.ClientUuid == myId;
var row = BuildRow(p.DisplayName ?? "???", me, p.IsOwner,
i % 2 == 0 ? C_ROW_A : C_ROW_B);
row.transform.SetParent(_listContent, false);
_rows.Add(row);
}
}
GameObject BuildRow(string playerName, bool isMe, bool isHostPlayer, Color bg)
{
const float ROW_H = 130f;
var go = new GameObject("PlayerRow");
var rt = go.AddComponent<RectTransform>();
rt.sizeDelta = new Vector2(0f, ROW_H);
var le = go.AddComponent<LayoutElement>();
le.minHeight = ROW_H;
le.preferredHeight = ROW_H;
Img(rt, bg);
// Bottom divider line
var divRT = RT("Div", rt);
divRT.anchorMin = new Vector2(0f, 0f);
divRT.anchorMax = new Vector2(1f, 0f);
divRT.pivot = new Vector2(0.5f, 0f);
divRT.offsetMin = new Vector2(20f, 0f);
divRT.offsetMax = new Vector2(-20f, 2f);
Img(divRT, C_DIVIDER);
float nameLeft = 24f;
// Crown emoji for lobby host
if (isHostPlayer)
{
var crownRT = RT("Crown", rt);
crownRT.anchorMin = new Vector2(0f, 0.5f);
crownRT.anchorMax = new Vector2(0f, 0.5f);
crownRT.pivot = new Vector2(0f, 0.5f);
crownRT.sizeDelta = new Vector2(90f, 90f);
crownRT.anchoredPosition = new Vector2(18f, 0f);
TmpDirect(crownRT, "👑", 52, C_GOLD, TextAlignmentOptions.Center);
nameLeft = 118f;
}
// Player name
float nameMaxX = isMe ? 0.68f : 1f;
var nameRT = RT("Name", rt);
nameRT.anchorMin = new Vector2(0f, 0f);
nameRT.anchorMax = new Vector2(nameMaxX, 1f);
nameRT.offsetMin = new Vector2(nameLeft, 6f);
nameRT.offsetMax = new Vector2(-10f, -6f);
var nt = nameRT.gameObject.AddComponent<TextMeshProUGUI>();
nt.text = playerName;
nt.fontSize = 48;
nt.color = isMe ? C_WHITE : C_SOFT;
nt.alignment = TextAlignmentOptions.MidlineLeft;
nt.fontStyle = isMe ? FontStyles.Bold : FontStyles.Normal;
nt.overflowMode = TextOverflowModes.Ellipsis;
// "YOU" badge
if (isMe)
{
var badgeRT = RT("YouBadge", rt);
badgeRT.anchorMin = new Vector2(0.68f, 0.22f);
badgeRT.anchorMax = new Vector2(1f, 0.78f);
badgeRT.offsetMin = new Vector2(0f, 0f);
badgeRT.offsetMax = new Vector2(-20f, 0f);
Img(badgeRT, C_ACCENT);
TxtChild(badgeRT, "YOU", 30, C_WHITE, TextAlignmentOptions.Center, bold: true);
}
return go;
}
// ── Layout helpers ────────────────────────────────────────────────────────
RectTransform RT(string name, Transform parent)
{
var go = new GameObject(name);
var rt = go.AddComponent<RectTransform>();
rt.SetParent(parent, false);
rt.localScale = Vector3.one;
return rt;
}
void Stretch(RectTransform rt)
{
rt.anchorMin = Vector2.zero;
rt.anchorMax = Vector2.one;
rt.offsetMin = Vector2.zero;
rt.offsetMax = Vector2.zero;
}
void Fill(RectTransform rt, float top, float bottom, float left = 0f, float right = 0f)
{
rt.anchorMin = Vector2.zero;
rt.anchorMax = Vector2.one;
rt.offsetMin = new Vector2(left, bottom);
rt.offsetMax = new Vector2(-right, -top);
}
void PinTop(RectTransform rt, float h)
{
rt.anchorMin = new Vector2(0f, 1f);
rt.anchorMax = new Vector2(1f, 1f);
rt.pivot = new Vector2(0.5f, 1f);
rt.offsetMin = new Vector2(0f, -h);
rt.offsetMax = Vector2.zero;
}
void PinBelowTop(RectTransform rt, float fromTop, float h)
{
rt.anchorMin = new Vector2(0f, 1f);
rt.anchorMax = new Vector2(1f, 1f);
rt.pivot = new Vector2(0.5f, 1f);
rt.offsetMin = new Vector2(0f, -(fromTop + h));
rt.offsetMax = new Vector2(0f, -fromTop);
}
void PinBottom(RectTransform rt, float h)
{
rt.anchorMin = Vector2.zero;
rt.anchorMax = new Vector2(1f, 0f);
rt.pivot = new Vector2(0.5f, 0f);
rt.offsetMin = Vector2.zero;
rt.offsetMax = new Vector2(0f, h);
}
// ── Graphic helpers ───────────────────────────────────────────────────────
/// Adds an Image directly to rt.
Image Img(RectTransform rt, Color c)
{
var img = rt.gameObject.AddComponent<Image>();
img.color = c;
return img;
}
/// Adds TMP directly to rt — only use when rt has NO Image component.
TMP_Text TmpDirect(RectTransform rt, string text, float size, Color color,
TextAlignmentOptions align, bool bold = false, bool italic = false)
{
var tmp = rt.gameObject.AddComponent<TextMeshProUGUI>();
tmp.text = text;
tmp.fontSize = size;
tmp.color = color;
tmp.alignment = align;
if (bold) tmp.fontStyle |= FontStyles.Bold;
if (italic) tmp.fontStyle |= FontStyles.Italic;
return tmp;
}
/// Creates a stretch-fill child GO with TMP — safe when parent already has Image.
TMP_Text TxtChild(RectTransform parent, string text, float size, Color color,
TextAlignmentOptions align, bool bold = false, bool italic = false)
{
var childRT = RT("Txt", parent);
Stretch(childRT);
return TmpDirect(childRT, text, size, color, align, bold, italic);
}
void Btn(RectTransform rt, Color normal, System.Action onClick)
{
var btn = rt.gameObject.AddComponent<Button>();
btn.targetGraphic = rt.gameObject.GetComponent<Image>();
btn.onClick.AddListener(() => onClick());
var cols = btn.colors;
cols.normalColor = normal;
cols.highlightedColor = Color.Lerp(normal, Color.white, 0.3f);
cols.pressedColor = Color.Lerp(normal, Color.black, 0.3f);
cols.selectedColor = normal;
btn.colors = cols;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 290610b7d8fb7ea675982694abac90ef
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,216 @@
using UnityEngine;
/// <summary>
/// Attach to Main Camera in Client.unity.
/// Top-down perspective camera that follows the local player capsule.
///
/// Features:
/// • Auto-follow player when tracking (can be paused by dragging)
/// • Single-finger touch drag (or mouse drag) to pan
/// • Pinch gesture (or mouse scroll wheel) to zoom (changes camera height)
/// • Double-tap anywhere to instantly recenter on player
/// • Static Recenter() method called by the HUD recenter button
/// </summary>
public class MapCameraController : MonoBehaviour
{
// ── Singleton (weak — no DontDestroyOnLoad needed, camera lives in Client.unity) ──
public static MapCameraController Instance { get; private set; }
// ── Public API ────────────────────────────────────────────────────────────
public void SetTarget(GameObject target) { _target = target; }
public void Recenter() { _isTracking = true; _resumeTimer = 0f; }
// ── Tuning ────────────────────────────────────────────────────────────────
private const float FollowSmoothing = 8f; // lerp speed when tracking
private const float DefaultHeight = 150f; // camera Y (metres above ground)
private const float MinHeight = 30f; // closest zoom
private const float MaxHeight = 350f; // furthest zoom
private const float PinchZoomSens = 1.2f; // multiplier for pinch speed
private const float ScrollZoomSens = 30f; // world-units per scroll tick
private const float ResumeDelay = 3.5f; // s after drag ends before auto-tracking resumes
private const float DoubleTapWindow = 0.32f; // s between taps to count as double
private const float DragThreshold = 8f; // pixels moved before drag starts
// ── Runtime state ─────────────────────────────────────────────────────────
private Camera _cam;
private GameObject _target;
private float _currentHeight;
private bool _isTracking = true;
private float _resumeTimer;
// Drag
private bool _dragActive;
private Vector2 _lastDragScreen;
// Pinch
private float _pinchStartDist = -1f;
private float _pinchStartHeight;
// Double-tap
private int _tapCount;
private float _tapTimer;
// ── MonoBehaviour ─────────────────────────────────────────────────────────
void Awake()
{
Instance = this;
_cam = GetComponent<Camera>();
if (_cam == null) { Debug.LogError("[MapCamera] No Camera component!"); return; }
// Keep existing perspective mode — just ensure straight-down orientation
transform.rotation = Quaternion.Euler(90f, 0f, 0f);
_currentHeight = transform.position.y > 1f ? transform.position.y : DefaultHeight;
transform.position = new Vector3(transform.position.x, _currentHeight, transform.position.z);
}
void OnEnable() { Instance = this; }
void LateUpdate()
{
HandleInput();
FollowTarget();
}
// ── Target following ──────────────────────────────────────────────────────
void FollowTarget()
{
if (!_isTracking || _target == null) return;
Vector3 tp = _target.transform.position;
Vector3 dest = new Vector3(tp.x, _currentHeight, tp.z);
transform.position = Vector3.Lerp(transform.position, dest, Time.deltaTime * FollowSmoothing);
}
// ── Input ─────────────────────────────────────────────────────────────────
void HandleInput()
{
// Auto-resume tracking after a period of no dragging
if (!_isTracking)
{
_resumeTimer += Time.deltaTime;
if (_resumeTimer >= ResumeDelay) _isTracking = true;
}
// Double-tap timer
_tapTimer += Time.deltaTime;
if (_tapTimer > DoubleTapWindow) _tapCount = 0;
int tc = Input.touchCount;
if (tc == 2)
{
HandlePinch();
return;
}
_pinchStartDist = -1f; // reset pinch when not 2 fingers
if (tc == 1)
{
Touch t = Input.GetTouch(0);
switch (t.phase)
{
case TouchPhase.Began:
OnPointerDown(t.position);
break;
case TouchPhase.Moved:
case TouchPhase.Stationary:
OnPointerDrag(t.position);
break;
case TouchPhase.Ended:
case TouchPhase.Canceled:
OnPointerUp();
break;
}
return;
}
// Mouse fallback (editor / desktop)
if (Input.GetMouseButtonDown(0)) OnPointerDown(Input.mousePosition);
else if (Input.GetMouseButton(0)) OnPointerDrag(Input.mousePosition);
else if (Input.GetMouseButtonUp(0)) OnPointerUp();
float scroll = Input.GetAxis("Mouse ScrollWheel");
if (Mathf.Abs(scroll) > 0.001f)
{
_currentHeight = Mathf.Clamp(_currentHeight - scroll * ScrollZoomSens, MinHeight, MaxHeight);
transform.position = new Vector3(transform.position.x, _currentHeight, transform.position.z);
}
}
void OnPointerDown(Vector2 screenPos)
{
_lastDragScreen = screenPos;
_dragActive = false;
// Double-tap detection
_tapCount++;
_tapTimer = 0f;
if (_tapCount >= 2)
{
_tapCount = 0;
Recenter();
}
}
void OnPointerDrag(Vector2 screenPos)
{
Vector2 screenDelta = screenPos - _lastDragScreen;
if (!_dragActive && screenDelta.magnitude > DragThreshold)
{
_dragActive = true;
_isTracking = false;
_resumeTimer = 0f;
}
if (_dragActive)
{
// Pan: move camera so that the world point under the finger stays fixed.
// Because the camera faces straight down, we can use a simpler formula:
// pixels → world = (camera height / focal length in pixels) ratio.
// For perspective: visible half-height at ground = height * tan(fov/2)
// world_per_pixel = 2 * height * tan(fov/2) / screenHeight
float halfFovRad = _cam.fieldOfView * 0.5f * Mathf.Deg2Rad;
float worldPerPixelY = 2f * _currentHeight * Mathf.Tan(halfFovRad) / Screen.height;
float worldPerPixelX = worldPerPixelY * ((float)Screen.width / Screen.height);
// Flip: dragging right moves world right (camera moves left)
transform.position += new Vector3(
-screenDelta.x * worldPerPixelX,
0f,
-screenDelta.y * worldPerPixelY
);
}
_lastDragScreen = screenPos;
}
void OnPointerUp()
{
_dragActive = false;
}
// ── Pinch zoom ────────────────────────────────────────────────────────────
void HandlePinch()
{
Touch t0 = Input.GetTouch(0);
Touch t1 = Input.GetTouch(1);
if (t0.phase == TouchPhase.Began || t1.phase == TouchPhase.Began)
{
_pinchStartDist = Vector2.Distance(t0.position, t1.position);
_pinchStartHeight = _currentHeight;
return;
}
if (_pinchStartDist <= 0f) return;
float currentDist = Vector2.Distance(t0.position, t1.position);
if (currentDist < 1f) return;
// Closer fingers = zoom in (lower height)
float ratio = _pinchStartDist / currentDist;
_currentHeight = Mathf.Clamp(_pinchStartHeight * ratio * PinchZoomSens, MinHeight, MaxHeight);
transform.position = new Vector3(transform.position.x, _currentHeight, transform.position.z);
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 2108dcbe61d3945f2aa588f69100e95f

View File

@@ -1,500 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.Xml;
using UnityEngine;
using UnityEngine.Networking;
[RequireComponent(typeof(MeshFilter), typeof(MeshRenderer))]
public class MapRenderer : MonoBehaviour
{
[Header("Overpass settings")]
public const string overpassUrl = "https://mapz.honzuvkod.dev/api/interpreter";
public float queryRadiusMeters = 200f; // radius around lat/lon to query
[Header("Location (lat, lon)")]
public GPSManager gpsManager;
private double latitude = 50.7727878;
private double longitude = 15.0718625;
[Header("Building settings")]
public Material buildingMaterial;
public float defaultFloorHeight = 3.0f; // meters per level
public float defaultBuildingHeight = 6.0f; // if no tags
[Header("Road settings")]
public Material roadMaterial;
public float defaultRoadWidth = 4.0f; // meters
public float motorwayWidth = 10.0f;
public float primaryWidth = 8.0f;
public float secondaryWidth = 6.0f;
public float tertiaryWidth = 5.0f;
[Header("Misc")]
public float _metersPerUnit = 1f; // scale: 1 unit = 1 meter
[Header("Storage")]
Dictionary<long, Vector2> nodes = new Dictionary<long, Vector2>(); // id -> latlon
List<Way> parsedWays = new List<Way>();
void Start()
{
StartCoroutine(RenderMap());
}
IEnumerator RenderMap()
{
ClearChildren();
double[] GPS = gpsManager.GetLastCoords();
latitude = GPS[0];
longitude = GPS[1];
string q = $"[out:xml][timeout:90];(way[\"building\"](around:{queryRadiusMeters.ToString().Replace(",", ".")},{latitude.ToString().Replace(",", ".")},{longitude.ToString().Replace(",", ".")});way[\"highway\"](around:{queryRadiusMeters.ToString().Replace(",", ".")},{latitude.ToString().Replace(",", ".")},{longitude.ToString().Replace(",", ".")}););(._;>;);out body;";
WWWForm form = new WWWForm();
form.AddField("data", q);
using (UnityWebRequest www = UnityWebRequest.Post(overpassUrl, form))
{
www.downloadHandler = new DownloadHandlerBuffer();
yield return www.SendWebRequest();
if (www.result != UnityWebRequest.Result.Success)
{
Debug.LogError("Overpass request failed: " + www.error);
yield break;
}
string xml = www.downloadHandler.text;
ParseOverpassXml(xml);
GameObject buildingsRoot = new GameObject("Buildings");
buildingsRoot.transform.parent = this.transform;
GameObject roadsRoot = new GameObject("Roads");
roadsRoot.transform.parent = this.transform;
foreach (var w in parsedWays)
{
if (w.tags.ContainsKey("building"))
{
GameObject b = BuildBuildingMesh(w);
b.transform.parent = buildingsRoot.transform;
}
else if (w.tags.ContainsKey("highway"))
{
GameObject r = BuildRoadMesh(w);
r.transform.parent = roadsRoot.transform;
}
}
Debug.Log("Map generation complete: " + parsedWays.Count + " ways, " + nodes.Count + " nodes.");
}
yield return StartCoroutine(RenderMap());
}
void ClearChildren()
{
List<GameObject> toDestroy = new List<GameObject>();
foreach (Transform t in transform)
toDestroy.Add(t.gameObject);
foreach (var g in toDestroy)
DestroyImmediate(g);
}
#region Overpass XML parsing
class Way
{
public long id;
public List<long> nodeRefs = new List<long>();
public Dictionary<string, string> tags = new Dictionary<string, string>();
}
void ParseOverpassXml(string xmlText)
{
nodes.Clear();
parsedWays.Clear();
XmlDocument doc = new XmlDocument();
doc.LoadXml(xmlText);
XmlNode osm = doc.SelectSingleNode("/osm");
if (osm == null) return;
// parse nodes
foreach (XmlNode node in osm.SelectNodes("node"))
{
long id = long.Parse(node.Attributes["id"].Value, CultureInfo.InvariantCulture);
double lat = double.Parse(node.Attributes["lat"].Value, CultureInfo.InvariantCulture);
double lon = double.Parse(node.Attributes["lon"].Value, CultureInfo.InvariantCulture);
nodes[id] = new Vector2((float)lat, (float)lon);
}
// parse ways
foreach (XmlNode wayNode in osm.SelectNodes("way"))
{
Way w = new Way();
w.id = long.Parse(wayNode.Attributes["id"].Value, CultureInfo.InvariantCulture);
foreach (XmlNode child in wayNode.ChildNodes)
{
if (child.Name == "nd")
{
long r = long.Parse(child.Attributes["ref"].Value, CultureInfo.InvariantCulture);
w.nodeRefs.Add(r);
}
else if (child.Name == "tag")
{
string k = child.Attributes["k"].Value;
string v = child.Attributes["v"].Value;
w.tags[k] = v;
}
}
parsedWays.Add(w);
}
}
#endregion
#region Utilities: latlon to local meters
// Convert latitude/longitude to local XY meters relative to center point
Vector3 LatLonToLocal(double lat, double lon)
{
// Use simple equirectangular projection around center (latitude, longitude)
double lat0 = latitude;
double lon0 = longitude;
double dLat = (lat - lat0) * Mathf.Deg2Rad;
double dLon = (lon - lon0) * Mathf.Deg2Rad;
double R = 6378137.0; // Earth radius in meters
double x = R * dLon * Math.Cos(lat0 * Mathf.Deg2Rad);
double y = R * dLat;
return new Vector3((float)x / _metersPerUnit, 0f, (float)y / _metersPerUnit);
}
Vector3 NodeIdToLocal(long nodeId)
{
if (!nodes.ContainsKey(nodeId))
return Vector3.zero;
Vector2 latlon = nodes[nodeId];
return LatLonToLocal(latlon.x, latlon.y);
}
#endregion
#region Mesh builders
GameObject BuildBuildingMesh(Way w)
{
// gather polygon points
List<Vector3> poly = new List<Vector3>();
foreach (var id in w.nodeRefs)
{
Vector3 p = NodeIdToLocal(id);
poly.Add(p);
}
// ensure closed
if (poly.Count < 3) return null;
if ((poly[0] - poly[poly.Count - 1]).sqrMagnitude > 0.0001f)
poly.Add(poly[0]);
// determine height
float height = defaultBuildingHeight;
if (w.tags.ContainsKey("height"))
{
if (TryParseHeight(w.tags["height"], out float h)) height = h;
}
else if (w.tags.ContainsKey("building:levels"))
{
if (float.TryParse(w.tags["building:levels"], NumberStyles.Float, CultureInfo.InvariantCulture, out float levels))
height = Mathf.Max(0.5f, levels * defaultFloorHeight);
}
else if (w.tags.ContainsKey("levels"))
{
if (float.TryParse(w.tags["levels"], NumberStyles.Float, CultureInfo.InvariantCulture, out float levels))
height = Mathf.Max(0.5f, levels * defaultFloorHeight);
}
// create GameObject
GameObject go = new GameObject("Building_" + w.id);
MeshFilter mf = go.AddComponent<MeshFilter>();
MeshRenderer mr = go.AddComponent<MeshRenderer>();
mr.material = buildingMaterial;
// generate mesh: roof (triangulated polygon) + walls (extruded quads)
Mesh mesh = new Mesh();
mesh.name = "BuildingMesh_" + w.id;
// Convert poly to 2D points (XZ plane)
List<Vector2> poly2D = new List<Vector2>();
for (int i = 0; i < poly.Count - 1; i++) // omit last repeated point
poly2D.Add(new Vector2(poly[i].x, poly[i].z));
// triangulate roof
List<int> roofTris = Triangulate(poly2D);
if (roofTris == null || roofTris.Count == 0)
{
Debug.LogWarning("Triangulation failed for building " + w.id);
return go;
}
// Build vertices: roof vertices at y=height, walls vertices (2 per poly vertex)
int n = poly2D.Count;
// Build vertices and triangles with NO SHARED VERTICES (flat shading)
List<Vector3> verts = new List<Vector3>();
List<int> triangles = new List<int>();
List<Vector2> uvs = new List<Vector2>();
// Roof triangles - each triangle gets its own vertices
for (int i = 0; i < roofTris.Count; i += 3)
{
int idx0 = roofTris[i];
int idx1 = roofTris[i + 1];
int idx2 = roofTris[i + 2];
Vector2 p0 = poly2D[idx0];
Vector2 p1 = poly2D[idx1];
Vector2 p2 = poly2D[idx2];
int baseIdx = verts.Count;
verts.Add(new Vector3(p0.x, height / _metersPerUnit, p0.y));
verts.Add(new Vector3(p1.x, height / _metersPerUnit, p1.y));
verts.Add(new Vector3(p2.x, height / _metersPerUnit, p2.y));
triangles.Add(baseIdx);
triangles.Add(baseIdx + 1);
triangles.Add(baseIdx + 2);
uvs.Add(new Vector2(p0.x, p0.y));
uvs.Add(new Vector2(p1.x, p1.y));
uvs.Add(new Vector2(p2.x, p2.y));
}
// Walls - each quad gets its own 4 vertices
for (int i = 0; i < n; i++)
{
int iNext = (i + 1) % n;
Vector2 p0 = poly2D[i];
Vector2 p1 = poly2D[iNext];
int baseIdx = verts.Count;
verts.Add(new Vector3(p0.x, height / _metersPerUnit, p0.y)); // top left
verts.Add(new Vector3(p0.x, 0, p0.y)); // bottom left
verts.Add(new Vector3(p1.x, 0, p1.y)); // bottom right
verts.Add(new Vector3(p1.x, height / _metersPerUnit, p1.y)); // top right
triangles.Add(baseIdx);
triangles.Add(baseIdx + 1);
triangles.Add(baseIdx + 2);
triangles.Add(baseIdx);
triangles.Add(baseIdx + 2);
triangles.Add(baseIdx + 3);
uvs.Add(new Vector2(0, 1));
uvs.Add(new Vector2(0, 0));
uvs.Add(new Vector2(1, 0));
uvs.Add(new Vector2(1, 1));
}
mesh.SetVertices(verts);
mesh.SetTriangles(triangles, 0);
mesh.SetUVs(0, uvs);
mesh.RecalculateNormals();
mesh.RecalculateBounds();
mf.mesh = mesh;
// Center object (using first roof vertex as reference)
Vector3 centroid = Vector3.zero;
for (int i = 0; i < roofTris.Count; i += 3)
{
centroid += verts[i];
}
centroid /= (roofTris.Count / 3);
go.transform.position = centroid * -1f;
// Move the roof/walls vertices back to local space
Vector3[] adjustedVerts = mesh.vertices;
for (int i = 0; i < adjustedVerts.Length; i++) adjustedVerts[i] += centroid;
mesh.vertices = adjustedVerts;
mesh.RecalculateNormals();
mesh.RecalculateBounds();
return go;
}
GameObject BuildRoadMesh(Way w)
{
// build polyline
List<Vector3> pts = new List<Vector3>();
foreach (var id in w.nodeRefs)
pts.Add(NodeIdToLocal(id));
if (pts.Count < 2) return null;
float width = defaultRoadWidth;
if (w.tags.ContainsKey("width") && float.TryParse(w.tags["width"], NumberStyles.Float, CultureInfo.InvariantCulture, out float wv))
width = wv;
else if (w.tags.ContainsKey("highway"))
{
// simple heuristic
string h = w.tags["highway"];
if (h == "motorway") width = motorwayWidth;
else if (h == "primary") width = primaryWidth;
else if (h == "secondary") width = secondaryWidth;
else if (h == "tertiary") width = tertiaryWidth;
else width = defaultRoadWidth;
}
GameObject go = new GameObject("Road_" + w.id);
MeshFilter mf = go.AddComponent<MeshFilter>();
MeshRenderer mr = go.AddComponent<MeshRenderer>();
mr.material = roadMaterial;
Mesh mesh = new Mesh();
mesh.name = "RoadMesh_" + w.id;
List<Vector3> verts = new List<Vector3>();
List<int> tris = new List<int>();
List<Vector2> uvs = new List<Vector2>();
// build quad strip
for (int i = 0; i < pts.Count; i++)
{
Vector3 p = pts[i];
Vector3 dir;
if (i == 0) dir = (pts[i + 1] - p).normalized;
else if (i == pts.Count - 1) dir = (p - pts[i - 1]).normalized;
else dir = (pts[i + 1] - pts[i - 1]).normalized;
Vector3 normal = Vector3.Cross(dir, Vector3.up).normalized;
Vector3 left = p + normal * (width * 0.5f / _metersPerUnit);
Vector3 right = p - normal * (width * 0.5f / _metersPerUnit);
verts.Add(left);
verts.Add(right);
uvs.Add(new Vector2(0, i));
uvs.Add(new Vector2(1, i));
if (i > 0)
{
int baseIdx = verts.Count - 4;
tris.Add(baseIdx + 0);
tris.Add(baseIdx + 2);
tris.Add(baseIdx + 1);
tris.Add(baseIdx + 1);
tris.Add(baseIdx + 2);
tris.Add(baseIdx + 3);
}
}
mesh.SetVertices(verts);
mesh.SetTriangles(tris, 0);
mesh.SetUVs(0, uvs);
mesh.RecalculateNormals();
mesh.RecalculateBounds();
mf.mesh = mesh;
go.transform.position = Vector3.zero;
return go;
}
#endregion
#region Helpers
bool TryParseHeight(string s, out float meters)
{
// try to parse heights like "12", "12.5m", "40 ft"
s = s.Trim();
meters = 0f;
if (s.EndsWith("m")) s = s.Substring(0, s.Length - 1).Trim();
if (float.TryParse(s, NumberStyles.Float, CultureInfo.InvariantCulture, out float v))
{
meters = v;
return true;
}
// fallback: try to extract number
StringBuilder num = new StringBuilder();
foreach (char c in s)
if ((c >= '0' && c <= '9') || c == '.' || c == ',') num.Append(c == ',' ? '.' : c);
if (num.Length > 0 && float.TryParse(num.ToString(), NumberStyles.Float, CultureInfo.InvariantCulture, out v))
{
meters = v; return true;
}
return false;
}
// Basic ear clipping triangulation for simple polygons (2D)
List<int> Triangulate(List<Vector2> poly)
{
List<int> indices = new List<int>();
int n = poly.Count;
if (n < 3) return indices;
List<int> V = new List<int>();
for (int i = 0; i < n; i++) V.Add(i);
int guard = 0;
while (V.Count > 3 && guard < 10000)
{
bool earFound = false;
for (int i = 0; i < V.Count; i++)
{
int prev = V[(i - 1 + V.Count) % V.Count];
int curr = V[i];
int next = V[(i + 1) % V.Count];
Vector2 a = poly[prev];
Vector2 b = poly[curr];
Vector2 c = poly[next];
if (!IsConvex(a, b, c)) continue;
bool hasPointInside = false;
for (int j = 0; j < V.Count; j++)
{
int vi = V[j];
if (vi == prev || vi == curr || vi == next) continue;
if (PointInTriangle(poly[vi], a, b, c)) { hasPointInside = true; break; }
}
if (hasPointInside) continue;
// ear found
indices.Add(prev);
indices.Add(curr);
indices.Add(next);
V.RemoveAt(i);
earFound = true;
break;
}
if (!earFound) break;
guard++;
}
if (V.Count == 3)
{
indices.Add(V[0]); indices.Add(V[1]); indices.Add(V[2]);
}
return indices;
}
bool IsConvex(Vector2 a, Vector2 b, Vector2 c)
{
return ((b.x - a.x) * (c.y - a.y) - (b.y - a.y) * (c.x - a.x)) < 0f; // changed > to
}
bool PointInTriangle(Vector2 p, Vector2 a, Vector2 b, Vector2 c)
{
float area = TriangleArea(a, b, c);
float area1 = TriangleArea(p, b, c);
float area2 = TriangleArea(a, p, c);
float area3 = TriangleArea(a, b, p);
return Mathf.Abs(area - (area1 + area2 + area3)) < 1e-3f;
}
float TriangleArea(Vector2 a, Vector2 b, Vector2 c)
{
return Mathf.Abs((a.x * (b.y - c.y) + b.x * (c.y - a.y) + c.x * (a.y - b.y)) * 0.5f);
}
#endregion
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 54e66fbdb6a33134a934139bbf7252ef

View File

@@ -0,0 +1,109 @@
using UnityEngine;
using UnityEngine.UI;
using TMPro;
/// <summary>
/// Attach to any GO in the main menu scene (e.g. UIManage).
/// Finds the "name" canvas button at runtime and converts it into a
/// fully functional TMP_InputField — preserving its RectTransform position/size.
/// </summary>
public class PlayerNameInput : MonoBehaviour
{
void Start()
{
var nameGO = GameObject.Find("name");
if (nameGO == null) { Debug.LogError("[PlayerNameInput] 'name' GO not found."); return; }
var rt = nameGO.GetComponent<RectTransform>();
if (rt == null) { Debug.LogError("[PlayerNameInput] 'name' has no RectTransform."); return; }
// Remove incompatible components (Button blocks input; old broken TMP_InputField)
var btn = nameGO.GetComponent<Button>();
if (btn != null) DestroyImmediate(btn);
var oldField = nameGO.GetComponent<TMP_InputField>();
if (oldField != null) DestroyImmediate(oldField);
// Remove all child GOs (Art-team text label children)
var kill = new System.Collections.Generic.List<GameObject>();
foreach (Transform child in rt) kill.Add(child.gameObject);
foreach (var go in kill) DestroyImmediate(go);
// Keep / ensure background Image
var img = nameGO.GetComponent<Image>();
if (img == null) img = nameGO.AddComponent<Image>();
img.color = new Color(0.08f, 0.10f, 0.20f, 0.92f);
// Build viewport > (Placeholder + Text) child hierarchy required by TMP_InputField
var viewportRT = MakeChild("Text Area", rt);
viewportRT.anchorMin = Vector2.zero;
viewportRT.anchorMax = Vector2.one;
viewportRT.offsetMin = new Vector2(14f, 4f);
viewportRT.offsetMax = new Vector2(-14f, -4f);
viewportRT.gameObject.AddComponent<RectMask2D>();
var phRT = MakeChild("Placeholder", viewportRT);
Stretch(phRT);
var ph = phRT.gameObject.AddComponent<TextMeshProUGUI>();
ph.text = "Enter your name...";
ph.fontSize = 40;
ph.color = new Color(0.55f, 0.60f, 0.70f, 0.85f);
ph.fontStyle = FontStyles.Italic;
ph.alignment = TextAlignmentOptions.MidlineLeft;
var txtRT = MakeChild("Text", viewportRT);
Stretch(txtRT);
var txt = txtRT.gameObject.AddComponent<TextMeshProUGUI>();
txt.text = "";
txt.fontSize = 40;
txt.color = Color.white;
txt.alignment = TextAlignmentOptions.MidlineLeft;
// Add TMP_InputField and wire all required references
var field = nameGO.AddComponent<TMP_InputField>();
field.textViewport = viewportRT;
field.textComponent = txt;
field.placeholder = ph;
field.targetGraphic = img;
field.characterLimit = 32;
field.keyboardType = TouchScreenKeyboardType.Default;
field.shouldHideMobileInput = false;
// Restore saved name
string saved = PlayerPrefs.GetString("PlayerName", "");
if (!string.IsNullOrEmpty(saved))
field.SetTextWithoutNotify(saved);
field.onValueChanged.AddListener(OnNameChanged);
// Write initial value to GameManager if present
if (!string.IsNullOrEmpty(saved))
OnNameChanged(saved);
}
void OnNameChanged(string value)
{
PlayerPrefs.SetString("PlayerName", value);
PlayerPrefs.Save();
var gm = GameManager.Instance;
if (gm == null) return;
gm.displayName = value;
if (gm.gameClient != null)
gm.gameClient.DisplayName = value;
}
RectTransform MakeChild(string name, RectTransform parent)
{
var go = new GameObject(name);
var rt = go.AddComponent<RectTransform>();
rt.SetParent(parent, false);
rt.localScale = Vector3.one;
return rt;
}
void Stretch(RectTransform rt)
{
rt.anchorMin = Vector2.zero;
rt.anchorMax = Vector2.one;
rt.offsetMin = rt.offsetMax = Vector2.zero;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a1305c74eacfaf90fd98134860492d46
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -38,17 +38,18 @@ public class FlappyBirdAllInOne : MonoBehaviour, ITask
public (double, double) TaskLocation { get; set; }
public bool IsCompleted { get; private set; }
private bool _isPaused = false;
void Start()
{
Time.timeScale = 1f;
_isPaused = false;
score = 0;
UpdateScore();
if (scoreText != null) UpdateScore();
}
void Update()
{
if (isDead) return;
if (isDead || _isPaused) return;
HandleInput();
HandleSpawning();
@@ -99,6 +100,10 @@ public class FlappyBirdAllInOne : MonoBehaviour, ITask
{
score++;
UpdateScore();
if (score >= 10)
{
Complete();
}
}
void UpdateScore()
@@ -110,14 +115,16 @@ public class FlappyBirdAllInOne : MonoBehaviour, ITask
public void GameOver()
{
isDead = true;
gameOverPanel.SetActive(true);
Time.timeScale = 0f;
_isPaused = true;
if (gameOverPanel != null) gameOverPanel.SetActive(true);
// NOTE: do NOT set Time.timeScale — GPS and network must keep running
}
public void Restart()
{
Time.timeScale = 1f;
SceneManager.LoadScene(SceneManager.GetActiveScene().name);
// TaskManager will unload and reload via additive loading
// Calling ExitTask lets TaskManager handle scene lifecycle
ExitTask(_onExit);
}

View File

@@ -1,7 +1,8 @@
using UnityEngine;
using UnityEngine.Events;
using System;
public class LevelManager : MonoBehaviour
public class LevelManager : MonoBehaviour, ITask
{
public static LevelManager Instance;
@@ -14,6 +15,40 @@ public class LevelManager : MonoBehaviour
private int scoredCount = 0;
// ── ITask ────────────────────────────────────────────────────────────────
public string TaskID { get; set; }
public TaskType TaskType { get; set; }
public string TaskName { get; set; }
public (double, double) TaskLocation { get; set; }
public bool IsCompleted { get; private set; }
private Action<ITask> _onCompleted;
private Action<ITask> _onExit;
public void Initialize(Action<ITask> onCompleted)
{
IsCompleted = false;
_onCompleted = onCompleted;
ResetCounter();
// Wire OnAllItemsScored to Complete() if not already wired
OnAllItemsScored.AddListener(Complete);
}
public void Complete()
{
if (IsCompleted) return;
IsCompleted = true;
Debug.Log("[LevelManager] Task complete!");
_onCompleted?.Invoke(this);
ExitTask(_onExit);
}
public void ExitTask(Action<ITask> onExit)
{
onExit?.Invoke(this);
}
// ─────────────────────────────────────────────────────────────────────────
void Awake()
{
if (Instance == null) Instance = this;
@@ -39,3 +74,4 @@ public class LevelManager : MonoBehaviour
public int GetScoredCount() => scoredCount;
public int GetTotalCount() => itemsToScore;
}

View File

@@ -37,6 +37,9 @@ public class DraggableKey : MonoBehaviour,
{
IsCompleted = false;
_onCompleted = onCompleted;
// Register ourselves with the manager so CheckWin can call Complete()
if (KeyminigameManager.Instance != null)
KeyminigameManager.Instance.taskRef = this;
}
public void Complete()

View File

@@ -8,6 +8,9 @@ public class KeyminigameManager : MonoBehaviour
private int correctCount = 0;
public int totalKeys = 3;
/// <summary>Set by DraggableKey.Initialize() so CheckWin can fire Complete().</summary>
[HideInInspector] public ITask taskRef;
private void Awake()
{
Instance = this;
@@ -16,15 +19,19 @@ public class KeyminigameManager : MonoBehaviour
public void CheckWin()
{
correctCount++;
Debug.Log($"Keys inserted: {correctCount}/{totalKeys}");
if (correctCount >= totalKeys)
{
Debug.Log("WIN");
Debug.Log("All keys inserted — task complete!");
taskRef?.Complete();
}
}
public void Fail()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex - 1);
Debug.Log("Wrong slot — exiting task.");
taskRef?.ExitTask(null);
// TaskManager handles unloading; no SceneManager.LoadScene here
}
}
}

View File

@@ -250,7 +250,13 @@ public class CableMiniGame : MonoBehaviour, ITask
IEnumerator BlinkAndExit(Cable cable)
{
if (cable.lineImage == null) CreateLineUI(cable);
if (cable.lineObject == null) CreateLineUI(cable);
if (cable.lineImage == null)
{
Debug.LogWarning("[BlinkAndExit] No lineImage, skipping blink.");
ExitTask(_onExit);
yield break;
}
Debug.Log("[BlinkAndExit] Wrong attempt, blinking...");
Color original = cable.lineImage.color;
@@ -262,8 +268,7 @@ public class CableMiniGame : MonoBehaviour, ITask
Debug.Log("[BlinkAndExit] Restored original color, exiting task.");
ExitTask(_onExit);
if (!string.IsNullOrEmpty(previousSceneName))
SceneManager.LoadScene(previousSceneName);
// NOTE: no SceneManager.LoadScene here — TaskManager handles unloading
}
void PrintAllCableStates(string context)

View File

@@ -0,0 +1,46 @@
using System;
using System.Collections;
using UnityEngine;
/// <summary>
/// Satellite minigame — auto-completes after 1 second.
/// Students can replace this with real gameplay via a PR.
/// </summary>
public class SatelitTask : MonoBehaviour, ITask
{
public string TaskID { get; set; }
public TaskType TaskType { get; set; }
public string TaskName { get; set; }
public (double, double) TaskLocation { get; set; }
public bool IsCompleted { get; private set; }
private Action<ITask> _onCompleted;
private Action<ITask> _onExit;
public void Initialize(Action<ITask> onCompleted)
{
IsCompleted = false;
_onCompleted = onCompleted;
StartCoroutine(AutoComplete());
}
public void Complete()
{
if (IsCompleted) return;
IsCompleted = true;
_onCompleted?.Invoke(this);
ExitTask(_onExit);
}
public void ExitTask(Action<ITask> onExit)
{
onExit?.Invoke(this);
}
private IEnumerator AutoComplete()
{
Debug.Log("[SatelitTask] Satellite task started — auto-completing in 1s.");
yield return new WaitForSeconds(1f);
Complete();
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 375a1ddbfc192413b48906965449af87
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -2,20 +2,24 @@
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2180264
Material:
serializedVersion: 6
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: LiberationSans SDF Material
m_Shader: {fileID: 4800000, guid: fe393ace9b354375a9cb14cdbbc28be4, type: 3}
m_ShaderKeywords:
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
@@ -67,6 +71,7 @@ Material:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Ambient: 0.5
- _Bevel: 0.5
@@ -148,6 +153,8 @@ Material:
- _ReflectOutlineColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UnderlayColor: {r: 0, g: 0, b: 0, a: 0.5}
m_BuildTextureStacks: []
m_AllowLocking: 1
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -161,11 +168,6 @@ MonoBehaviour:
m_Name: LiberationSans SDF - Fallback
m_EditorClassIdentifier:
m_Version: 1.1.0
m_Material: {fileID: 2180264}
m_SourceFontFileGUID: e3265ab4bf004d28a9537516768c1c75
m_SourceFontFile: {fileID: 12800000, guid: e3265ab4bf004d28a9537516768c1c75, type: 3}
m_AtlasPopulationMode: 1
InternalDynamicOS: 0
m_FaceInfo:
m_FaceIndex: 0
m_FamilyName: Liberation Sans
@@ -188,57 +190,8 @@ MonoBehaviour:
m_StrikethroughOffset: 18
m_StrikethroughThickness: 6.298828
m_TabWidth: 24
m_GlyphTable: []
m_CharacterTable: []
m_AtlasTextures:
- {fileID: 28268798066460806}
m_AtlasTextureIndex: 0
m_IsMultiAtlasTexturesEnabled: 1
m_ClearDynamicDataOnBuild: 1
m_UsedGlyphRects: []
m_FreeGlyphRects:
- m_X: 0
m_Y: 0
m_Width: 511
m_Height: 511
m_fontInfo:
Name: Liberation Sans
PointSize: 86
Scale: 1
CharacterCount: 250
LineHeight: 98.90625
Baseline: 0
Ascender: 77.84375
CapHeight: 59.1875
Descender: -18.21875
CenterLine: 0
SuperscriptOffset: 77.84375
SubscriptOffset: -12.261719
SubSize: 0.5
Underline: -12.261719
UnderlineThickness: 6.298828
strikethrough: 23.675
strikethroughThickness: 0
TabWidth: 239.0625
Padding: 9
AtlasWidth: 1024
AtlasHeight: 1024
atlas: {fileID: 0}
m_AtlasWidth: 512
m_AtlasHeight: 512
m_AtlasPadding: 9
m_AtlasRenderMode: 4169
m_glyphInfoList: []
m_KerningTable:
kerningPairs: []
m_FontFeatureTable:
m_MultipleSubstitutionRecords: []
m_LigatureSubstitutionRecords: []
m_GlyphPairAdjustmentRecords: []
m_MarkToBaseAdjustmentRecords: []
m_MarkToMarkAdjustmentRecords: []
fallbackFontAssets: []
m_FallbackFontAssetTable: []
m_Material: {fileID: 2180264}
m_SourceFontFileGUID: e3265ab4bf004d28a9537516768c1c75
m_CreationSettings:
sourceFontFileName:
sourceFontFileGUID: e3265ab4bf004d28a9537516768c1c75
@@ -258,6 +211,36 @@ MonoBehaviour:
fontStyleModifier: 0
renderMode: 4169
includeFontFeatures: 1
m_SourceFontFile: {fileID: 12800000, guid: e3265ab4bf004d28a9537516768c1c75, type: 3}
m_SourceFontFilePath:
m_AtlasPopulationMode: 1
InternalDynamicOS: 0
m_GlyphTable: []
m_CharacterTable: []
m_AtlasTextures:
- {fileID: 28268798066460806}
m_AtlasTextureIndex: 0
m_IsMultiAtlasTexturesEnabled: 1
m_GetFontFeatures: 1
m_ClearDynamicDataOnBuild: 1
m_AtlasWidth: 512
m_AtlasHeight: 512
m_AtlasPadding: 9
m_AtlasRenderMode: 4169
m_UsedGlyphRects: []
m_FreeGlyphRects:
- m_X: 0
m_Y: 0
m_Width: 511
m_Height: 511
m_FontFeatureTable:
m_MultipleSubstitutionRecords: []
m_LigatureSubstitutionRecords: []
m_GlyphPairAdjustmentRecords: []
m_MarkToBaseAdjustmentRecords: []
m_MarkToMarkAdjustmentRecords: []
m_ShouldReimportFontFeatures: 0
m_FallbackFontAssetTable: []
m_FontWeightTable:
- regularTypeface: {fileID: 0}
italicTypeface: {fileID: 0}
@@ -306,6 +289,33 @@ MonoBehaviour:
boldSpacing: 7
italicStyle: 35
tabSize: 10
m_fontInfo:
Name: Liberation Sans
PointSize: 86
Scale: 1
CharacterCount: 250
LineHeight: 98.90625
Baseline: 0
Ascender: 77.84375
CapHeight: 59.1875
Descender: -18.21875
CenterLine: 0
SuperscriptOffset: 77.84375
SubscriptOffset: -12.261719
SubSize: 0.5
Underline: -12.261719
UnderlineThickness: 6.298828
strikethrough: 23.675
strikethroughThickness: 0
TabWidth: 239.0625
Padding: 9
AtlasWidth: 1024
AtlasHeight: 1024
m_glyphInfoList: []
m_KerningTable:
kerningPairs: []
fallbackFontAssets: []
atlas: {fileID: 0}
--- !u!28 &28268798066460806
Texture2D:
m_ObjectHideFlags: 0
@@ -316,17 +326,21 @@ Texture2D:
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
serializedVersion: 2
m_Width: 0
m_Height: 0
m_CompleteImageSize: 0
m_IsAlphaChannelOptional: 0
serializedVersion: 4
m_Width: 1
m_Height: 1
m_CompleteImageSize: 1
m_MipsStripped: 0
m_TextureFormat: 1
m_MipCount: 1
m_IsReadable: 1
m_IsPreProcessed: 0
m_IgnoreMipmapLimit: 0
m_MipmapLimitGroupName:
m_StreamingMipmaps: 0
m_StreamingMipmapsPriority: 0
m_VTOnly: 0
m_AlphaIsTransparency: 0
m_ImageCount: 1
m_TextureDimension: 2
@@ -340,9 +354,11 @@ Texture2D:
m_WrapW: 0
m_LightmapFormat: 0
m_ColorSpace: 0
image data: 0
_typelessdata:
m_PlatformBlob:
image data: 1
_typelessdata: 00
m_StreamData:
serializedVersion: 2
offset: 0
size: 0
path:

View File

@@ -1,143 +0,0 @@
fileFormatVersion: 2
guid: f39c83cede024654b8b01f3ed649efc8
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: bd359125026cdc144a1f35a5c8607b45

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: d0a79df83e583b147b8f08cd4a8a96a8

8
Assets/_Recovery.meta Normal file
View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b9c8f9e5bbf063b4fb1152966129a495
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Assets/host a join.meta Normal file
View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0f6331bfef5b3a00cb6f84141e60f9c4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Assets/main menu.meta Normal file
View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 43d195e24415843378eb1b53e9e1da18
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: