Commit 81cb57be by alsunj

wait for players to connect and and gameplayingtag to start the game

parent eb4285c5
Showing with 541 additions and 189 deletions
......@@ -6,6 +6,9 @@ public class EntitiesReferencesAuthoring : MonoBehaviour
{
public GameObject playerPrefabGameObject;
public GameObject RespawnEntity;
public GameObject RougeEnemyGameObject;
public GameObject SlimeEnemyGameObject;
public GameObject HealthBarPrefab;
public class Baker : Baker<EntitiesReferencesAuthoring>
......@@ -15,7 +18,9 @@ public class EntitiesReferencesAuthoring : MonoBehaviour
Entity entity = GetEntity(TransformUsageFlags.Dynamic);
AddComponent(entity, new EntititesReferences
{
playerPrefabEntity = GetEntity(authoring.playerPrefabGameObject, TransformUsageFlags.Dynamic),
PlayerPrefabEntity = GetEntity(authoring.playerPrefabGameObject, TransformUsageFlags.Dynamic),
RougeEnemyEntity = GetEntity(authoring.RougeEnemyGameObject, TransformUsageFlags.Dynamic),
SlimeEnemyEntity = GetEntity(authoring.SlimeEnemyGameObject, TransformUsageFlags.Dynamic),
RespawnEntity = GetEntity(authoring.RespawnEntity, TransformUsageFlags.None)
});
AddComponentObject(entity, new UIPrefabs
......@@ -31,7 +36,10 @@ public class EntitiesReferencesAuthoring : MonoBehaviour
public struct EntititesReferences : IComponentData
{
public Entity playerPrefabEntity;
public Entity PlayerPrefabEntity;
public Entity RougeEnemyEntity;
public Entity SlimeEnemyEntity;
public Entity RespawnEntity;
}
......
fileFormatVersion: 2
guid: 55b823e47914f9f4fba8b5a443660640
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using Unity.Entities;
using UnityEngine;
public class GameStartPropertiesAuthoring : MonoBehaviour
{
public int gameStartCountDownTime;
public class GameStartPropertiesBaker : Baker<GameStartPropertiesAuthoring>
{
public override void Bake(GameStartPropertiesAuthoring authoring)
{
Entity entity = GetEntity(TransformUsageFlags.None);
AddComponent(entity, new GameStartProperties
{
CountdownTime = authoring.gameStartCountDownTime,
});
AddComponent(entity, new SpawnableEnemiesCounter
{
SlimeEnemyCounter = 0,
RogueEnemyCounter = 0
});
AddComponent<PlayersRemainingToStart>(entity);
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 9ad6c4754c599be47b8b5b4400eb8acc
\ No newline at end of file
using Unity.Entities;
using Unity.NetCode;
public struct GamePlayingTag : IComponentData
{
}
public struct GameStartTick : IComponentData
{
public NetworkTick Value;
}
public struct GameStartProperties : IComponentData
{
public int CountdownTime;
public int PlayerAmount;
public int RogueEnemyAmount;
public int SlimeEnemyAmount;
}
public struct PlayerCounter : IComponentData
{
public int Value;
}
public struct SpawnableEnemiesCounter : IComponentData
{
public int SlimeEnemyCounter;
public int RogueEnemyCounter;
}
\ No newline at end of file
fileFormatVersion: 2
guid: 6a4b580d47a4b3643907a89462a3d17f
\ No newline at end of file
using Unity.NetCode;
using UnityEngine;
public struct GoInGameRequestRpc : IRpcCommand
{
......@@ -9,13 +8,6 @@ public struct ClientConnectionRpc : IRpcCommand
{
}
public struct EnemyAmountRpc : IRpcCommand
{
public int PlayerAmount;
public int RogueEnemyAmount;
public int SlimeEnemyAmount;
}
public struct PlayersRemainingToStart : IRpcCommand
{
public int Value;
......
using Unity.Collections;
using Unity.Entities;
using Unity.Mathematics;
using Unity.NetCode;
using Unity.Transforms;
using UnityEngine;
......@@ -16,7 +14,6 @@ public partial struct ClientRequestGameEntrySystem : ISystem
.WithNone<NetworkStreamInGame>();
state.RequireForUpdate(state.GetEntityQuery(entityQueryBuilder));
entityQueryBuilder.Dispose();
state.RequireForUpdate<ClientConnectionRpc>();
}
public void OnUpdate(ref SystemState state)
......@@ -37,8 +34,8 @@ public partial struct ClientRequestGameEntrySystem : ISystem
FollowPlayer followScript = playerCameraGO.AddComponent<FollowPlayer>();
followScript.networkId = networkId.ValueRO.Value; // Store networkId instead of dire
entityCommandBuffer.AddComponent(requestGameConnection, new GoInGameRequestRpc());
entityCommandBuffer.AddComponent(requestGameConnection, new SendRpcCommandRequest());
entityCommandBuffer.AddComponent<GoInGameRequestRpc>(requestGameConnection);
entityCommandBuffer.AddComponent<SendRpcCommandRequest>(requestGameConnection);
}
entityCommandBuffer.Playback(state.EntityManager);
......@@ -55,7 +52,6 @@ public partial struct ThinClientRequestGameEntrySystem : ISystem
.WithNone<NetworkStreamInGame>();
state.RequireForUpdate(state.GetEntityQuery(entityQueryBuilder));
entityQueryBuilder.Dispose();
state.RequireForUpdate<ClientConnectionRpc>();
}
public void OnUpdate(ref SystemState state)
......@@ -72,8 +68,8 @@ public partial struct ThinClientRequestGameEntrySystem : ISystem
var requestGameConnection = entityCommandBuffer.CreateEntity();
entityCommandBuffer.AddComponent(requestGameConnection, new GoInGameRequestRpc());
entityCommandBuffer.AddComponent(requestGameConnection, new SendRpcCommandRequest());
entityCommandBuffer.AddComponent<GoInGameRequestRpc>(requestGameConnection);
entityCommandBuffer.AddComponent<SendRpcCommandRequest>(requestGameConnection);
}
entityCommandBuffer.Playback(state.EntityManager);
......
using System;
using Unity.Burst;
using Unity.Collections;
using Unity.Entities;
using Unity.NetCode;
partial struct ClientStartGameSystem : ISystem
[WorldSystemFilter(WorldSystemFilterFlags.ClientSimulation)]
public partial class ClientStartGameSystem : SystemBase
{
[BurstCompile]
public void OnCreate(ref SystemState state)
{
}
public Action<int> OnUpdatePlayersRemainingToStart;
public Action OnStartGameCountdown;
[BurstCompile]
public void OnUpdate(ref SystemState state)
protected override void OnUpdate()
{
}
var ecb = new EntityCommandBuffer(Allocator.Temp);
[BurstCompile]
public void OnDestroy(ref SystemState state)
{
foreach (var (playersRemainingToStart, entity) in SystemAPI.Query<PlayersRemainingToStart>()
.WithAll<ReceiveRpcCommandRequest>().WithEntityAccess())
{
ecb.DestroyEntity(entity);
OnUpdatePlayersRemainingToStart?.Invoke(playersRemainingToStart.Value);
}
foreach (var (gameStartTick, entity) in SystemAPI.Query<GameStartTickRpc>()
.WithAll<ReceiveRpcCommandRequest>().WithEntityAccess())
{
ecb.DestroyEntity(entity);
OnStartGameCountdown?.Invoke();
var gameStartEntity = ecb.CreateEntity();
//creates the entity about when the game has started on client side
ecb.AddComponent(gameStartEntity, new GameStartTick
{
Value = gameStartTick.Value
});
}
ecb.Playback(EntityManager);
}
}
}
\ No newline at end of file
using System;
using Unity.Burst;
using Unity.Collections;
using Unity.Entities;
using Unity.Mathematics;
using Unity.NetCode;
[UpdateInGroup(typeof(PredictedSimulationSystemGroup))]
public partial class CountdownToGameStartSystem : SystemBase
{
public Action<int> OnUpdateCountdownText;
public Action OnCountdownEnd;
protected override void OnCreate()
{
RequireForUpdate<NetworkTime>();
}
protected override void OnUpdate()
{
var networkTime = SystemAPI.GetSingleton<NetworkTime>();
if (!networkTime.IsFirstTimeFullyPredictingTick) return;
var currentTick = networkTime.ServerTick;
var ecb = new EntityCommandBuffer(Allocator.Temp);
foreach (var (gameStartTick, entity) in SystemAPI.Query<GameStartTick>().WithAll<Simulate>().WithEntityAccess())
{
if (currentTick.Equals(gameStartTick.Value) || currentTick.IsNewerThan(gameStartTick.Value))
{
var gamePlayingEntity = ecb.CreateEntity();
ecb.SetName(gamePlayingEntity, "GamePlayingEntity");
ecb.AddComponent<GamePlayingTag>(gamePlayingEntity);
ecb.DestroyEntity(entity);
OnCountdownEnd?.Invoke();
}
else
{
var ticksToStart = gameStartTick.Value.TickIndexForValidTick - currentTick.TickIndexForValidTick;
var simulationTickRate = NetCodeConfig.Global.ClientServerTickRate.SimulationTickRate;
var secondsToStart = (int)math.ceil((float)ticksToStart / simulationTickRate);
OnUpdateCountdownText?.Invoke(secondsToStart);
}
}
ecb.Playback(EntityManager);
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: a3d2365e397acb8428489444c6f254fe
\ No newline at end of file
using Unity.Burst;
using Unity.Collections;
using Unity.Entities;
using Unity.NetCode;
using UnityEngine;
// using Unity.Burst;
// using Unity.Collections;
// using Unity.Entities;
// using Unity.NetCode;
// using UnityEngine;
//
// [WorldSystemFilter(WorldSystemFilterFlags.ClientSimulation | WorldSystemFilterFlags.ThinClientSimulation)]
// partial struct GoInGameClientSystem : ISystem
// {
// [BurstCompile]
// public void OnCreate(ref SystemState state)
// {
// EntityQueryBuilder entityQueryBuilder = new EntityQueryBuilder(Allocator.Temp)
// .WithAll<NetworkId>()
// .WithNone<NetworkStreamInGame>();
// state.RequireForUpdate(state.GetEntityQuery(entityQueryBuilder));
// entityQueryBuilder.Dispose();
// }
//
// public void OnUpdate(ref SystemState state)
// {
// EntityCommandBuffer entityCommandBuffer = new EntityCommandBuffer(Unity.Collections.Allocator.Temp);
// foreach ((
// RefRO<NetworkId> networkId,
// Entity entity)
// in SystemAPI.Query
// <RefRO<NetworkId>>().WithNone<NetworkStreamInGame>().WithEntityAccess())
// {
// entityCommandBuffer.AddComponent<NetworkStreamInGame>(entity);
//
// Entity rpcEntity = entityCommandBuffer.CreateEntity();
// GameObject playerCameraGO = new GameObject($"Camera{networkId.ValueRO.Value}");
// playerCameraGO.AddComponent<Camera>();
//
// // Assign the player entity to FollowPlayer script
// FollowPlayer followScript = playerCameraGO.AddComponent<FollowPlayer>();
// followScript.networkId = networkId.ValueRO.Value; // Store networkId instead of dire
//
// entityCommandBuffer.AddComponent<GoInGameRequestRpc>(rpcEntity);
// entityCommandBuffer.AddComponent<SendRpcCommandRequest>(rpcEntity);
// }
//
// entityCommandBuffer.Playback(state.EntityManager);
// }
//
// [BurstCompile]
// public void OnDestroy(ref SystemState state)
// {
// }
// }
[WorldSystemFilter(WorldSystemFilterFlags.ClientSimulation | WorldSystemFilterFlags.ThinClientSimulation)]
partial struct GoInGameClientSystem : ISystem
{
[BurstCompile]
public void OnCreate(ref SystemState state)
{
EntityQueryBuilder entityQueryBuilder = new EntityQueryBuilder(Allocator.Temp)
.WithAll<NetworkId>()
.WithNone<NetworkStreamInGame>();
state.RequireForUpdate(state.GetEntityQuery(entityQueryBuilder));
entityQueryBuilder.Dispose();
}
public void OnUpdate(ref SystemState state)
{
EntityCommandBuffer entityCommandBuffer = new EntityCommandBuffer(Unity.Collections.Allocator.Temp);
foreach ((
RefRO<NetworkId> networkId,
Entity entity)
in SystemAPI.Query
<RefRO<NetworkId>>().WithNone<NetworkStreamInGame>().WithEntityAccess())
{
entityCommandBuffer.AddComponent<NetworkStreamInGame>(entity);
Entity rpcEntity = entityCommandBuffer.CreateEntity();
GameObject playerCameraGO = new GameObject($"Camera{networkId.ValueRO.Value}");
playerCameraGO.AddComponent<Camera>();
// Assign the player entity to FollowPlayer script
FollowPlayer followScript = playerCameraGO.AddComponent<FollowPlayer>();
followScript.networkId = networkId.ValueRO.Value; // Store networkId instead of dire
entityCommandBuffer.AddComponent<GoInGameRequestRpc>(rpcEntity);
entityCommandBuffer.AddComponent<SendRpcCommandRequest>(rpcEntity);
}
entityCommandBuffer.Playback(state.EntityManager);
}
[BurstCompile]
public void OnDestroy(ref SystemState state)
{
}
}
\ No newline at end of file
......@@ -11,6 +11,7 @@ partial struct GoInGameServerSystem : ISystem
[BurstCompile]
public void OnCreate(ref SystemState state)
{
state.RequireForUpdate<PlayerCounter>();
state.RequireForUpdate<EntititesReferences>();
state.RequireForUpdate<NetworkId>();
state.RequireForUpdate<GoInGameRequestRpc>();
......@@ -21,7 +22,12 @@ partial struct GoInGameServerSystem : ISystem
{
EntityCommandBuffer entityCommandBuffer = new EntityCommandBuffer(Unity.Collections.Allocator.Temp);
EntititesReferences entititesReferences = SystemAPI.GetSingleton<EntititesReferences>();
Entity gameStartPropertiesEntity = SystemAPI.GetSingletonEntity<PlayerCounter>();
PlayerCounter playerCounter = SystemAPI.GetComponent<PlayerCounter>(gameStartPropertiesEntity);
GameStartProperties gameStartProperties =
SystemAPI.GetComponent<GameStartProperties>(gameStartPropertiesEntity);
foreach ((
RefRO<ReceiveRpcCommandRequest> receiveRpcCommandRequest,
Entity entity) in
......@@ -36,7 +42,7 @@ partial struct GoInGameServerSystem : ISystem
// Instantiate player entity and place randomly on the x axis -+10
Entity playerEntity = entityCommandBuffer.Instantiate(entititesReferences.playerPrefabEntity);
Entity playerEntity = entityCommandBuffer.Instantiate(entititesReferences.PlayerPrefabEntity);
entityCommandBuffer.SetComponent(playerEntity, LocalTransform.FromPosition(new float3(
UnityEngine.Random.Range(-10, +10), 0, 0)));
......@@ -51,9 +57,41 @@ partial struct GoInGameServerSystem : ISystem
{
Value = playerEntity
});
playerCounter.Value++;
int playersRemainingToStart = gameStartProperties.PlayerAmount - playerCounter.Value;
var gameStartRpc = entityCommandBuffer.CreateEntity();
if (playersRemainingToStart <= 0 && !SystemAPI.HasSingleton<GamePlayingTag>())
{
var simulationTickRate = NetCodeConfig.Global.ClientServerTickRate.SimulationTickRate;
var ticksUntilStart = (uint)(simulationTickRate * gameStartProperties.CountdownTime);
var gameStartTick = SystemAPI.GetSingleton<NetworkTime>().ServerTick;
gameStartTick.Add(ticksUntilStart);
// sends data to client about on what tick the game should start.
entityCommandBuffer.AddComponent(gameStartRpc, new GameStartTickRpc
{
Value = gameStartTick
});
//creates the entity about when the game has started on server side
var gameStartEntity = entityCommandBuffer.CreateEntity();
entityCommandBuffer.AddComponent(gameStartEntity, new GameStartTick
{
Value = gameStartTick
});
}
else
{
entityCommandBuffer.AddComponent(gameStartRpc,
new PlayersRemainingToStart { Value = playersRemainingToStart });
}
entityCommandBuffer.AddComponent<SendRpcCommandRequest>(gameStartRpc);
}
entityCommandBuffer.Playback(state.EntityManager);
SystemAPI.SetSingleton(playerCounter);
}
[BurstCompile]
......
using Unity.Burst;
using Unity.Collections;
using Unity.Entities;
using Unity.NetCode;
[WorldSystemFilter(WorldSystemFilterFlags.ServerSimulation)]
partial struct ServerStartGameSystem : ISystem
{
[BurstCompile]
public void OnCreate(ref SystemState state)
{
state.RequireForUpdate<NetworkTime>();
state.RequireForUpdate<GameStartProperties>();
state.RequireForUpdate<EntititesReferences>();
state.RequireForUpdate<GamePlayingTag>(); // var builder = new EntityQueryBuilder(Allocator.Temp).WithAll<MobaTeamRequest, ReceiveRpcCommandRequest>();
// state.RequireForUpdate(state.GetEntityQuery(builder));
}
[BurstCompile]
public void OnUpdate(ref SystemState state)
{
}
[BurstCompile]
public void OnDestroy(ref SystemState state)
{
}
}
}
\ No newline at end of file
......@@ -49,10 +49,10 @@ public partial class RespawnPlayerSystem : SystemBase
{
if (isServer)
{
var networkId = SystemAPI.GetComponent<NetworkId>(curRespawn.NetworkEntity).Value;
int networkId = SystemAPI.GetComponent<NetworkId>(curRespawn.NetworkEntity).Value;
var playerPrefab = SystemAPI.GetSingleton<EntititesReferences>().playerPrefabEntity;
var newPlayer = ecb.Instantiate(playerPrefab);
Entity playerPrefab = SystemAPI.GetSingleton<EntititesReferences>().PlayerPrefabEntity;
Entity newPlayer = ecb.Instantiate(playerPrefab);
ecb.SetComponent(newPlayer, new GhostOwner { NetworkId = networkId });
ecb.SetComponent(newPlayer,
......
......@@ -15,7 +15,11 @@ public class ClientConnectionManager : MonoBehaviour
[SerializeField] private TMP_InputField _playerAmountField;
[SerializeField] private TMP_InputField _RogueEnemyAmountField;
[SerializeField] private TMP_InputField _SlimeEnemyAmountField;
[SerializeField] private GameObject LobbyAmountContainer;
[SerializeField] private GameObject RangerAmountContainer;
[SerializeField] private GameObject SlimeAmountContainer;
[SerializeField] private Button _connectButton;
[SerializeField] private int _gameStartCountDownTime;
private ushort Port => ushort.Parse(_portField.text);
private int PlayerAmount => int.Parse(_playerAmountField.text);
......@@ -45,12 +49,15 @@ public class ClientConnectionManager : MonoBehaviour
{
case 0:
buttonLabel = "Start Host";
LobbyAmountContainer.SetActive(true);
RangerAmountContainer.SetActive(true);
SlimeAmountContainer.SetActive(true);
break;
case 1:
buttonLabel = "Start Server";
break;
case 2:
buttonLabel = "Start Client";
LobbyAmountContainer.SetActive(false);
RangerAmountContainer.SetActive(false);
SlimeAmountContainer.SetActive(false);
break;
default:
buttonLabel = "<ERROR>";
......@@ -62,6 +69,7 @@ public class ClientConnectionManager : MonoBehaviour
buttonText.text = buttonLabel;
}
private void OnButtonConnect()
{
DestroyLocalSimulationWorld();
......@@ -74,9 +82,6 @@ public class ClientConnectionManager : MonoBehaviour
StartClient();
break;
case 1:
StartServer();
break;
case 2:
StartClient();
break;
default:
......@@ -107,14 +112,21 @@ public class ClientConnectionManager : MonoBehaviour
serverWorld.EntityManager.CreateEntityQuery(ComponentType.ReadWrite<NetworkStreamDriver>());
networkDriverQuery.GetSingletonRW<NetworkStreamDriver>().ValueRW.Listen(serverEndpoint);
}
var enemyAmountEntity = serverWorld.EntityManager.CreateEntity();
serverWorld.EntityManager.AddComponentData(enemyAmountEntity, new EnemyAmountRpc
// Create the entity and add components directly.
var configEntity = serverWorld.EntityManager.CreateEntity();
serverWorld.EntityManager.AddComponentData(configEntity, new GameStartProperties
{
CountdownTime = _gameStartCountDownTime,
PlayerAmount = PlayerAmount,
RogueEnemyAmount = RogueEnemyAmount,
SlimeEnemyAmount = SlimeEnemyAmount
});
serverWorld.EntityManager.AddComponentData(configEntity, new SpawnableEnemiesCounter
{
SlimeEnemyCounter = 0,
RogueEnemyCounter = 0
});
serverWorld.EntityManager.AddComponentData(configEntity, new PlayerCounter { Value = 0 });
}
private void StartClient()
......
using System.Collections;
using TMPro;
using Unity.Entities;
using Unity.NetCode;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class GameStartUIController : MonoBehaviour
{
[SerializeField] private GameObject _beginGamePanel;
[SerializeField] private GameObject _confirmQuitPanel;
[SerializeField] private GameObject _countdownPanel;
[SerializeField] private Button _quitWaitingButton;
[SerializeField] private Button _confirmQuitButton;
[SerializeField] private Button _cancelQuitButton;
[SerializeField] private TextMeshProUGUI _waitingText;
[SerializeField] private TextMeshProUGUI _countdownText;
private EntityQuery _networkConnectionQuery;
private EntityManager _entityManager;
private void OnEnable()
{
_beginGamePanel.SetActive(true);
_quitWaitingButton.onClick.AddListener(AttemptQuitWaiting);
_confirmQuitButton.onClick.AddListener(ConfirmQuit);
_cancelQuitButton.onClick.AddListener(CancelQuit);
if (World.DefaultGameObjectInjectionWorld == null) return;
_entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
_networkConnectionQuery = _entityManager.CreateEntityQuery(typeof(NetworkStreamConnection));
var startGameSystem = World.DefaultGameObjectInjectionWorld.GetExistingSystemManaged<ClientStartGameSystem>();
if (startGameSystem != null)
{
startGameSystem.OnUpdatePlayersRemainingToStart += UpdatePlayerRemainingText;
startGameSystem.OnStartGameCountdown += BeginCountdown;
}
var countdownSystem = World.DefaultGameObjectInjectionWorld
.GetExistingSystemManaged<CountdownToGameStartSystem>();
if (countdownSystem != null)
{
countdownSystem.OnUpdateCountdownText += UpdateCountdownText;
countdownSystem.OnCountdownEnd += EndCountdown;
}
}
private void OnDisable()
{
_quitWaitingButton.onClick.RemoveAllListeners();
_confirmQuitButton.onClick.RemoveAllListeners();
_cancelQuitButton.onClick.RemoveAllListeners();
if (World.DefaultGameObjectInjectionWorld == null) return;
var startGameSystem = World.DefaultGameObjectInjectionWorld.GetExistingSystemManaged<ClientStartGameSystem>();
if (startGameSystem != null)
{
startGameSystem.OnUpdatePlayersRemainingToStart -= UpdatePlayerRemainingText;
startGameSystem.OnStartGameCountdown -= BeginCountdown;
}
var countdownSystem = World.DefaultGameObjectInjectionWorld
.GetExistingSystemManaged<CountdownToGameStartSystem>();
if (countdownSystem != null)
{
countdownSystem.OnUpdateCountdownText -= UpdateCountdownText;
countdownSystem.OnCountdownEnd -= EndCountdown;
}
}
private void UpdatePlayerRemainingText(int playersRemainingToStart)
{
var playersText = playersRemainingToStart == 1 ? "player" : "players";
_waitingText.text = $"Waiting for {playersRemainingToStart.ToString()} more {playersText} to join...";
}
private void UpdateCountdownText(int countdownTime)
{
_countdownText.text = countdownTime.ToString();
}
private void AttemptQuitWaiting()
{
_beginGamePanel.SetActive(false);
_confirmQuitPanel.SetActive(true);
}
private void ConfirmQuit()
{
StartCoroutine(DisconnectDelay());
}
IEnumerator DisconnectDelay()
{
yield return new WaitForSeconds(1f);
if (_networkConnectionQuery.TryGetSingletonEntity<NetworkStreamConnection>(out var networkConnectionEntity))
{
World.DefaultGameObjectInjectionWorld.EntityManager.AddComponent<NetworkStreamRequestDisconnect>(
networkConnectionEntity);
}
World.DisposeAllWorlds();
SceneManager.LoadScene(0);
}
private void CancelQuit()
{
_confirmQuitPanel.SetActive(false);
_beginGamePanel.SetActive(true);
}
private void BeginCountdown()
{
_beginGamePanel.SetActive(false);
_confirmQuitPanel.SetActive(false);
_countdownPanel.SetActive(true);
}
private void EndCountdown()
{
_countdownPanel.SetActive(false);
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: acd1a90c6b93e8a4ebf28b99386b7892
\ No newline at end of file
......@@ -1285,7 +1285,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: "7979\u200B"
m_text: "1\u200B"
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
......@@ -1421,7 +1421,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Ranger Enemy
m_text: 'Ranger Amount:'
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
......@@ -1557,7 +1557,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 'Connection Port:'
m_text: 'Slime Amount:'
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
......@@ -2178,9 +2178,6 @@ MonoBehaviour:
- m_Text: Host (Client + Server)
m_Image: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
- m_Text: Server (Server Only)
m_Image: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
- m_Text: Client (Client Only)
m_Image: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
......@@ -2625,7 +2622,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: "7979\u200B"
m_text: "100\u200B"
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
......@@ -2709,7 +2706,7 @@ GameObject:
- component: {fileID: 7879318744620076301}
- component: {fileID: 3534326167216121825}
m_Layer: 5
m_Name: PortInputField (TMP)
m_Name: PlayerInputField (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
......@@ -2859,7 +2856,7 @@ MonoBehaviour:
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: 7979
m_Text: 1
m_CaretBlinkRate: 0.85
m_CaretWidth: 1
m_ReadOnly: 0
......@@ -3003,7 +3000,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: "7979\u200B"
m_text: "10\u200B"
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
......@@ -3214,7 +3211,7 @@ GameObject:
- component: {fileID: 7912536268569717590}
- component: {fileID: 8650075725555599494}
m_Layer: 5
m_Name: PortInputField (TMP)
m_Name: RangerInputField (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
......@@ -3364,7 +3361,7 @@ MonoBehaviour:
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: 7979
m_Text: 10
m_CaretBlinkRate: 0.85
m_CaretWidth: 1
m_ReadOnly: 0
......@@ -4640,7 +4637,7 @@ GameObject:
- component: {fileID: 1920909873846200060}
- component: {fileID: 5105218363004495263}
m_Layer: 5
m_Name: PortInputField (TMP)
m_Name: SlimeInputField (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
......@@ -4790,7 +4787,7 @@ MonoBehaviour:
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: 7979
m_Text: 100
m_CaretBlinkRate: 0.85
m_CaretWidth: 1
m_ReadOnly: 0
......
......@@ -119,6 +119,17 @@ NavMeshSettings:
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!114 &42035500 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 5105218363004495263, guid: 72327351aa28fbe4fb4c16c3d17e4de5, type: 3}
m_PrefabInstance: {fileID: 7438304585132253660}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2da0c512f12947e489f739169773d7ca, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &167584907
GameObject:
m_ObjectHideFlags: 0
......@@ -471,8 +482,36 @@ MonoBehaviour:
_addressField: {fileID: 393054154}
_portField: {fileID: 723240685}
_connectionModeDropdown: {fileID: 746543760}
_teamDropdown: {fileID: 0}
_playerAmountField: {fileID: 1789477738}
_RogueEnemyAmountField: {fileID: 1734898360}
_SlimeEnemyAmountField: {fileID: 42035500}
LobbyAmountContainer: {fileID: 7438304585132253663}
RangerAmountContainer: {fileID: 7438304585132253662}
SlimeAmountContainer: {fileID: 7438304585132253661}
_connectButton: {fileID: 661734915}
_gameStartCountDownTime: 10
--- !u!114 &1734898360 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 8650075725555599494, guid: 72327351aa28fbe4fb4c16c3d17e4de5, type: 3}
m_PrefabInstance: {fileID: 7438304585132253660}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2da0c512f12947e489f739169773d7ca, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1789477738 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 3534326167216121825, guid: 72327351aa28fbe4fb4c16c3d17e4de5, type: 3}
m_PrefabInstance: {fileID: 7438304585132253660}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2da0c512f12947e489f739169773d7ca, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &7438304585132253660
PrefabInstance:
m_ObjectHideFlags: 0
......@@ -589,10 +628,6 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2786951246866498643, guid: 72327351aa28fbe4fb4c16c3d17e4de5, type: 3}
propertyPath: m_text
value: 'Ranger Amount:'
objectReference: {fileID: 0}
- target: {fileID: 3040996727634378079, guid: 72327351aa28fbe4fb4c16c3d17e4de5, type: 3}
propertyPath: m_AnchorMax.y
value: 0
......@@ -685,10 +720,6 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5105218363004495263, guid: 72327351aa28fbe4fb4c16c3d17e4de5, type: 3}
propertyPath: m_Text
value: 100
objectReference: {fileID: 0}
- target: {fileID: 5331613406234217351, guid: 72327351aa28fbe4fb4c16c3d17e4de5, type: 3}
propertyPath: m_AnchorMax.y
value: 0
......@@ -737,10 +768,6 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5823486262143737526, guid: 72327351aa28fbe4fb4c16c3d17e4de5, type: 3}
propertyPath: m_text
value: 'Slime Amount:'
objectReference: {fileID: 0}
- target: {fileID: 5897803869160389310, guid: 72327351aa28fbe4fb4c16c3d17e4de5, type: 3}
propertyPath: m_AnchorMax.y
value: 0
......@@ -857,10 +884,6 @@ PrefabInstance:
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8650075725555599494, guid: 72327351aa28fbe4fb4c16c3d17e4de5, type: 3}
propertyPath: m_Text
value: 10
objectReference: {fileID: 0}
- target: {fileID: 8875326252354947531, guid: 72327351aa28fbe4fb4c16c3d17e4de5, type: 3}
propertyPath: m_Pivot.x
value: 0
......@@ -946,6 +969,21 @@ PrefabInstance:
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 72327351aa28fbe4fb4c16c3d17e4de5, type: 3}
--- !u!1 &7438304585132253661 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 7340525383002667710, guid: 72327351aa28fbe4fb4c16c3d17e4de5, type: 3}
m_PrefabInstance: {fileID: 7438304585132253660}
m_PrefabAsset: {fileID: 0}
--- !u!1 &7438304585132253662 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 856385695763539090, guid: 72327351aa28fbe4fb4c16c3d17e4de5, type: 3}
m_PrefabInstance: {fileID: 7438304585132253660}
m_PrefabAsset: {fileID: 0}
--- !u!1 &7438304585132253663 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 6840826048180085601, guid: 72327351aa28fbe4fb4c16c3d17e4de5, type: 3}
m_PrefabInstance: {fileID: 7438304585132253660}
m_PrefabAsset: {fileID: 0}
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
......
......@@ -380,18 +380,10 @@ PrefabInstance:
propertyPath: m_Name
value: HUDCanvas
objectReference: {fileID: 0}
- target: {fileID: 1033715538230118892, guid: dc695439125c44a4190bdc008aa5a0fc, type: 3}
propertyPath: 'm_ActiveFontFeatures.Array.data[0]'
value: 1801810542
objectReference: {fileID: 0}
- target: {fileID: 1796973617372691604, guid: dc695439125c44a4190bdc008aa5a0fc, type: 3}
- target: {fileID: 1792365681371560561, guid: dc695439125c44a4190bdc008aa5a0fc, type: 3}
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1828345383611332528, guid: dc695439125c44a4190bdc008aa5a0fc, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2274541876267278006, guid: dc695439125c44a4190bdc008aa5a0fc, type: 3}
propertyPath: m_Pivot.x
value: 0
......@@ -472,38 +464,8 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3459062252518051838, guid: dc695439125c44a4190bdc008aa5a0fc, type: 3}
propertyPath: 'm_ActiveFontFeatures.Array.data[0]'
value: 1801810542
objectReference: {fileID: 0}
- target: {fileID: 4313165332373534701, guid: dc695439125c44a4190bdc008aa5a0fc, type: 3}
propertyPath: 'm_ActiveFontFeatures.Array.data[0]'
value: 1801810542
objectReference: {fileID: 0}
- target: {fileID: 4776685628420966923, guid: dc695439125c44a4190bdc008aa5a0fc, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4973084550295746815, guid: dc695439125c44a4190bdc008aa5a0fc, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5706297442706245628, guid: dc695439125c44a4190bdc008aa5a0fc, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6766818103523215656, guid: dc695439125c44a4190bdc008aa5a0fc, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8914969948828194284, guid: dc695439125c44a4190bdc008aa5a0fc, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects:
- {fileID: 4776685628420966923, guid: dc695439125c44a4190bdc008aa5a0fc, type: 3}
- {fileID: 6766818103523215656, guid: dc695439125c44a4190bdc008aa5a0fc, type: 3}
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: dc695439125c44a4190bdc008aa5a0fc, type: 3}
......
......@@ -171,6 +171,10 @@ PrefabInstance:
propertyPath: m_Name
value: Slime
objectReference: {fileID: 0}
- target: {fileID: 2899838405596494908, guid: 90328a79d7583f749a2b13d989efcaa8, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
......@@ -228,6 +232,10 @@ PrefabInstance:
propertyPath: m_Name
value: Slime
objectReference: {fileID: 0}
- target: {fileID: 2899838405596494908, guid: 90328a79d7583f749a2b13d989efcaa8, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
......@@ -393,6 +401,10 @@ PrefabInstance:
propertyPath: m_Name
value: Slime
objectReference: {fileID: 0}
- target: {fileID: 2899838405596494908, guid: 90328a79d7583f749a2b13d989efcaa8, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
......@@ -412,7 +424,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4119712591281040369, guid: 31ddab13d76d526499c2002833a10312, type: 3}
propertyPath: m_IsActive
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4518211183990774724, guid: 31ddab13d76d526499c2002833a10312, type: 3}
propertyPath: m_LocalPosition.x
......@@ -511,6 +523,10 @@ PrefabInstance:
propertyPath: m_Name
value: Slime
objectReference: {fileID: 0}
- target: {fileID: 2899838405596494908, guid: 90328a79d7583f749a2b13d989efcaa8, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
......@@ -530,7 +546,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4119712591281040369, guid: 31ddab13d76d526499c2002833a10312, type: 3}
propertyPath: m_IsActive
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4518211183990774724, guid: 31ddab13d76d526499c2002833a10312, type: 3}
propertyPath: m_LocalPosition.x
......@@ -633,6 +649,10 @@ PrefabInstance:
propertyPath: m_Name
value: Slime
objectReference: {fileID: 0}
- target: {fileID: 2899838405596494908, guid: 90328a79d7583f749a2b13d989efcaa8, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
......@@ -690,6 +710,10 @@ PrefabInstance:
propertyPath: m_Name
value: Slime
objectReference: {fileID: 0}
- target: {fileID: 2899838405596494908, guid: 90328a79d7583f749a2b13d989efcaa8, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
......@@ -709,7 +733,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4119712591281040369, guid: 31ddab13d76d526499c2002833a10312, type: 3}
propertyPath: m_IsActive
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4518211183990774724, guid: 31ddab13d76d526499c2002833a10312, type: 3}
propertyPath: m_LocalPosition.x
......@@ -770,7 +794,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4119712591281040369, guid: 31ddab13d76d526499c2002833a10312, type: 3}
propertyPath: m_IsActive
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4518211183990774724, guid: 31ddab13d76d526499c2002833a10312, type: 3}
propertyPath: m_LocalPosition.x
......@@ -916,6 +940,10 @@ PrefabInstance:
propertyPath: m_Name
value: Slime
objectReference: {fileID: 0}
- target: {fileID: 2899838405596494908, guid: 90328a79d7583f749a2b13d989efcaa8, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
......@@ -935,7 +963,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4119712591281040369, guid: 31ddab13d76d526499c2002833a10312, type: 3}
propertyPath: m_IsActive
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4518211183990774724, guid: 31ddab13d76d526499c2002833a10312, type: 3}
propertyPath: m_LocalPosition.x
......@@ -996,7 +1024,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4119712591281040369, guid: 31ddab13d76d526499c2002833a10312, type: 3}
propertyPath: m_IsActive
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4518211183990774724, guid: 31ddab13d76d526499c2002833a10312, type: 3}
propertyPath: m_LocalPosition.x
......@@ -1095,6 +1123,10 @@ PrefabInstance:
propertyPath: m_Name
value: Slime
objectReference: {fileID: 0}
- target: {fileID: 2899838405596494908, guid: 90328a79d7583f749a2b13d989efcaa8, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7946462240341238627, guid: 90328a79d7583f749a2b13d989efcaa8, type: 3}
propertyPath: DamageOnTrigger
value: 50
......@@ -1118,7 +1150,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4119712591281040369, guid: 31ddab13d76d526499c2002833a10312, type: 3}
propertyPath: m_IsActive
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4518211183990774724, guid: 31ddab13d76d526499c2002833a10312, type: 3}
propertyPath: m_LocalPosition.x
......@@ -1217,6 +1249,10 @@ PrefabInstance:
propertyPath: m_Name
value: Slime
objectReference: {fileID: 0}
- target: {fileID: 2899838405596494908, guid: 90328a79d7583f749a2b13d989efcaa8, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment