Commit 752a165c by alsunj

Merge branch 'feat/start-game-conf' into 'main'

test build

See merge request alsunj/loputoo_entities!6
parents eb4285c5 b8fdcb7a
Showing with 988 additions and 304 deletions
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3}
m_Name: DefaultVolumeProfile
m_EditorClassIdentifier:
components: []
fileFormatVersion: 2 fileFormatVersion: 2
guid: cd69de227738309429193c9089949c16 guid: ebc6411791715df47bb80a005a0a8aa0
NativeFormatImporter: NativeFormatImporter:
externalObjects: {} externalObjects: {}
mainObjectFileID: 11400000 mainObjectFileID: 11400000
......
...@@ -12,7 +12,7 @@ MonoBehaviour: ...@@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: abd30ee0214cf6a45b2d76765a4615b1, type: 3} m_Script: {fileID: 11500000, guid: abd30ee0214cf6a45b2d76765a4615b1, type: 3}
m_Name: NetCodeConfig m_Name: NetCodeConfig
m_EditorClassIdentifier: m_EditorClassIdentifier:
IsGlobalConfig: 0 IsGlobalConfig: 1
EnableClientServerBootstrap: 1 EnableClientServerBootstrap: 1
ClientServerTickRate: ClientServerTickRate:
SimulationTickRate: 60 SimulationTickRate: 60
......
fileFormatVersion: 2
guid: edda5bd0f33a95e4a98f780e0e3ae9e8
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: bda2f1b023323c34c8b930f637e07a0e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
...@@ -3,17 +3,7 @@ guid: e8747e16efffd7a47afd2563a3a381bd ...@@ -3,17 +3,7 @@ guid: e8747e16efffd7a47afd2563a3a381bd
ModelImporter: ModelImporter:
serializedVersion: 22200 serializedVersion: 22200
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: externalObjects: {}
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: Glow
second: {fileID: 2100000, guid: f6302e761ef5d1640934bc5d9d008ff2, type: 2}
- first:
type: UnityEngine:Material
assembly: UnityEngine.CoreModule
name: skeleton
second: {fileID: 2100000, guid: bc07391a2b9d8aa41ba5374abc9bcdc2, type: 2}
materials: materials:
materialImportMode: 2 materialImportMode: 2
materialName: 0 materialName: 0
...@@ -2766,7 +2756,7 @@ ModelImporter: ...@@ -2766,7 +2756,7 @@ ModelImporter:
maskType: 3 maskType: 3
maskSource: {instanceID: 0} maskSource: {instanceID: 0}
additiveReferencePoseFrame: 0 additiveReferencePoseFrame: 0
isReadable: 0 isReadable: 1
meshes: meshes:
lODScreenPercentages: [] lODScreenPercentages: []
globalScale: 1 globalScale: 1
...@@ -2812,7 +2802,7 @@ ModelImporter: ...@@ -2812,7 +2802,7 @@ ModelImporter:
blendShapeNormalImportMode: 1 blendShapeNormalImportMode: 1
normalSmoothingSource: 0 normalSmoothingSource: 0
referencedClips: [] referencedClips: []
importAnimation: 1 importAnimation: 0
humanDescription: humanDescription:
serializedVersion: 3 serializedVersion: 3
human: [] human: []
...@@ -2831,7 +2821,7 @@ ModelImporter: ...@@ -2831,7 +2821,7 @@ ModelImporter:
skeletonHasParents: 1 skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0} lastHumanDescriptionAvatarSource: {instanceID: 0}
autoGenerateAvatarMappingIfUnspecified: 1 autoGenerateAvatarMappingIfUnspecified: 1
animationType: 2 animationType: 0
humanoidOversampling: 1 humanoidOversampling: 1
avatarSetup: 0 avatarSetup: 0
addHumanoidExtraRootOnlyWhenUsingAvatar: 1 addHumanoidExtraRootOnlyWhenUsingAvatar: 1
......
...@@ -30,7 +30,7 @@ ModelImporter: ...@@ -30,7 +30,7 @@ ModelImporter:
extraExposedTransformPaths: [] extraExposedTransformPaths: []
extraUserProperties: [] extraUserProperties: []
clipAnimations: [] clipAnimations: []
isReadable: 0 isReadable: 1
meshes: meshes:
lODScreenPercentages: [] lODScreenPercentages: []
globalScale: 1 globalScale: 1
...@@ -76,7 +76,7 @@ ModelImporter: ...@@ -76,7 +76,7 @@ ModelImporter:
blendShapeNormalImportMode: 1 blendShapeNormalImportMode: 1
normalSmoothingSource: 0 normalSmoothingSource: 0
referencedClips: [] referencedClips: []
importAnimation: 1 importAnimation: 0
humanDescription: humanDescription:
serializedVersion: 3 serializedVersion: 3
human: [] human: []
......
using Unity.Collections;
using Unity.Entities;
using Unity.Mathematics;
using UnityEngine;
public class EnemySpawnAuthoring : MonoBehaviour
{
public Transform[] spawnPoints;
public class EnemySpawnPointsBaker : Baker<EnemySpawnAuthoring>
{
public override void Bake(EnemySpawnAuthoring authoring)
{
Entity entity = GetEntity(TransformUsageFlags.None);
DynamicBuffer<EnemySpawnPoints> dynamicBuffer = AddBuffer<EnemySpawnPoints>(entity);
foreach (Transform spawnPoint in authoring.spawnPoints)
{
dynamicBuffer.Add(new EnemySpawnPoints
{
SpawnPoint = new float3(spawnPoint.position)
});
}
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 879de81ec7d6996419454632d5ecf789
\ No newline at end of file
...@@ -6,6 +6,9 @@ public class EntitiesReferencesAuthoring : MonoBehaviour ...@@ -6,6 +6,9 @@ public class EntitiesReferencesAuthoring : MonoBehaviour
{ {
public GameObject playerPrefabGameObject; public GameObject playerPrefabGameObject;
public GameObject RespawnEntity; public GameObject RespawnEntity;
public GameObject RougeEnemyGameObject;
public GameObject SlimeEnemyGameObject;
public GameObject HealthBarPrefab; public GameObject HealthBarPrefab;
public class Baker : Baker<EntitiesReferencesAuthoring> public class Baker : Baker<EntitiesReferencesAuthoring>
...@@ -15,15 +18,15 @@ public class EntitiesReferencesAuthoring : MonoBehaviour ...@@ -15,15 +18,15 @@ public class EntitiesReferencesAuthoring : MonoBehaviour
Entity entity = GetEntity(TransformUsageFlags.Dynamic); Entity entity = GetEntity(TransformUsageFlags.Dynamic);
AddComponent(entity, new EntititesReferences 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) RespawnEntity = GetEntity(authoring.RespawnEntity, TransformUsageFlags.None)
}); });
AddComponentObject(entity, new UIPrefabs AddComponentObject(entity, new UIPrefabs
{ {
HealthBar = authoring.HealthBarPrefab, HealthBar = authoring.HealthBarPrefab,
}); });
// AddComponent<PhysicsMass>(entity, PhysicsMass.CreateDynamic(MassProperties.UnitSphere, 1f));
// AddComponent<PhysicsDamping>(entity, new PhysicsDamping { Linear = 0.01f, Angular = 0.05f });
} }
} }
} }
...@@ -31,7 +34,10 @@ public class EntitiesReferencesAuthoring : MonoBehaviour ...@@ -31,7 +34,10 @@ public class EntitiesReferencesAuthoring : MonoBehaviour
public struct EntititesReferences : IComponentData public struct EntititesReferences : IComponentData
{ {
public Entity playerPrefabEntity; public Entity PlayerPrefabEntity;
public Entity RougeEnemyEntity;
public Entity SlimeEnemyEntity;
public Entity RespawnEntity; public Entity RespawnEntity;
} }
......
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
fileFormatVersion: 2
guid: b6519e75046df8947ac07f03a2f4dc84
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using Unity.Collections;
using Unity.Entities;
using Unity.Mathematics;
public struct EnemySpawnPoints : IBufferElementData
{
public float3 SpawnPoint;
}
public struct EnemySpawnTimer : IComponentData
{
public float SlimeSpawnTimer;
public float RogueSpawnTimer;
public float RandomSpawnOffset;
public float SlimeSpawnCooldown;
public float RogueSpawnCooldown;
}
\ No newline at end of file
fileFormatVersion: 2
guid: 04304173520457f4c9f70fcb8a8d5e29
\ No newline at end of file
using Unity.NetCode; using Unity.NetCode;
using UnityEngine;
public struct GoInGameRequestRpc : IRpcCommand public struct GoInGameRequestRpc : IRpcCommand
{ {
...@@ -9,13 +8,6 @@ public struct ClientConnectionRpc : 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 struct PlayersRemainingToStart : IRpcCommand
{ {
public int Value; public int Value;
......
...@@ -6,7 +6,7 @@ using Unity.Physics.Systems; ...@@ -6,7 +6,7 @@ using Unity.Physics.Systems;
[UpdateInGroup(typeof(PhysicsSystemGroup))] [UpdateInGroup(typeof(PhysicsSystemGroup))]
[UpdateAfter(typeof(PhysicsSimulationGroup))] [UpdateAfter(typeof(PhysicsSimulationGroup))]
public partial struct DamageOnTriggerSystem : ISystem public partial struct DamageOnCollisionSystem : ISystem
{ {
public void OnCreate(ref SystemState state) public void OnCreate(ref SystemState state)
{ {
...@@ -18,7 +18,7 @@ public partial struct DamageOnTriggerSystem : ISystem ...@@ -18,7 +18,7 @@ public partial struct DamageOnTriggerSystem : ISystem
public void OnUpdate(ref SystemState state) public void OnUpdate(ref SystemState state)
{ {
var ecbSingleton = SystemAPI.GetSingleton<EndSimulationEntityCommandBufferSystem.Singleton>(); var ecbSingleton = SystemAPI.GetSingleton<EndSimulationEntityCommandBufferSystem.Singleton>();
var damageOnTriggerJob = new DamageOnTriggerJob var damageOnCollisionJob = new DamageOnCollisionJob
{ {
DamageOnTriggerLookup = SystemAPI.GetComponentLookup<DamageOnTrigger>(true), DamageOnTriggerLookup = SystemAPI.GetComponentLookup<DamageOnTrigger>(true),
TeamLookup = SystemAPI.GetComponentLookup<TeamTypes>(true), TeamLookup = SystemAPI.GetComponentLookup<TeamTypes>(true),
...@@ -26,59 +26,69 @@ public partial struct DamageOnTriggerSystem : ISystem ...@@ -26,59 +26,69 @@ public partial struct DamageOnTriggerSystem : ISystem
DamageBufferLookup = SystemAPI.GetBufferLookup<DamageBufferElement>(true), DamageBufferLookup = SystemAPI.GetBufferLookup<DamageBufferElement>(true),
ECB = ecbSingleton.CreateCommandBuffer(state.WorldUnmanaged) ECB = ecbSingleton.CreateCommandBuffer(state.WorldUnmanaged)
}; };
var simulationSingleton = SystemAPI.GetSingleton<SimulationSingleton>(); var simulationSingleton = SystemAPI.GetSingleton<SimulationSingleton>();
state.Dependency = damageOnTriggerJob.Schedule(simulationSingleton, state.Dependency); damageOnCollisionJob.Schedule(simulationSingleton, state.Dependency).Complete();
} }
} }
public struct DamageOnTriggerJob : ITriggerEventsJob public struct DamageOnCollisionJob : ICollisionEventsJob
{ {
[ReadOnly] public ComponentLookup<DamageOnTrigger> DamageOnTriggerLookup; [ReadOnly] public ComponentLookup<DamageOnTrigger> DamageOnTriggerLookup;
[ReadOnly] public ComponentLookup<TeamTypes> TeamLookup; [ReadOnly] public ComponentLookup<TeamTypes> TeamLookup;
[ReadOnly] public BufferLookup<AlreadyDamagedEntity> AlreadyDamagedLookup; public BufferLookup<AlreadyDamagedEntity> AlreadyDamagedLookup;
[ReadOnly] public BufferLookup<DamageBufferElement> DamageBufferLookup; public BufferLookup<DamageBufferElement> DamageBufferLookup;
public EntityCommandBuffer ECB; public EntityCommandBuffer ECB;
public void Execute(TriggerEvent triggerEvent) public void Execute(CollisionEvent collisionEvent)
{ {
Entity damageDealingEntity; Entity entityA = collisionEvent.EntityA;
Entity damageReceivingEntity; Entity entityB = collisionEvent.EntityB;
Entity damageDealingEntity = Entity.Null;
Entity damageReceivingEntity = Entity.Null;
if (DamageBufferLookup.HasBuffer(triggerEvent.EntityA) && if (DamageBufferLookup.HasBuffer(entityA) &&
DamageOnTriggerLookup.HasComponent(triggerEvent.EntityB)) DamageOnTriggerLookup.HasComponent(entityB))
{ {
damageReceivingEntity = triggerEvent.EntityA; damageReceivingEntity = entityA;
damageDealingEntity = triggerEvent.EntityB; damageDealingEntity = entityB;
} }
else if (DamageOnTriggerLookup.HasComponent(triggerEvent.EntityA) && else if (DamageOnTriggerLookup.HasComponent(entityA) &&
DamageBufferLookup.HasBuffer(triggerEvent.EntityB)) DamageBufferLookup.HasBuffer(entityB))
{ {
damageDealingEntity = triggerEvent.EntityA; damageDealingEntity = entityA;
damageReceivingEntity = triggerEvent.EntityB; damageReceivingEntity = entityB;
} }
else else
{ {
return; return;
} }
// Don't apply damage multiple times if (AlreadyDamagedLookup.HasBuffer(damageDealingEntity))
var alreadyDamagedBuffer = AlreadyDamagedLookup[damageDealingEntity]; {
foreach (var alreadyDamagedEntity in alreadyDamagedBuffer) var alreadyDamagedBuffer = AlreadyDamagedLookup[damageDealingEntity];
for (int i = 0; i < alreadyDamagedBuffer.Length; i++)
{
if (alreadyDamagedBuffer[i].Value == damageReceivingEntity) return;
}
}
else
{ {
if (alreadyDamagedEntity.Value.Equals(damageReceivingEntity)) return; ECB.AddBuffer<AlreadyDamagedEntity>(damageDealingEntity);
} }
// Ignore friendly fire
if (TeamLookup.TryGetComponent(damageDealingEntity, out var damageDealingTeam) && if (TeamLookup.TryGetComponent(damageDealingEntity, out var damageDealingTeam) &&
TeamLookup.TryGetComponent(damageReceivingEntity, out var damageReceivingTeam)) TeamLookup.TryGetComponent(damageReceivingEntity, out var damageReceivingTeam))
{ {
if (damageDealingTeam.Value == damageReceivingTeam.Value) return; if (damageDealingTeam.Value == damageReceivingTeam.Value) return;
} }
var damageOnTrigger = DamageOnTriggerLookup[damageDealingEntity]; if (DamageOnTriggerLookup.TryGetComponent(damageDealingEntity, out var damageOnTrigger))
ECB.AddComponent<DestroyEntityTag>(damageDealingEntity); {
ECB.AppendToBuffer(damageReceivingEntity, new DamageBufferElement { Value = damageOnTrigger.Value }); ECB.AddComponent<DestroyEntityTag>(damageDealingEntity);
ECB.AppendToBuffer(damageDealingEntity, new AlreadyDamagedEntity { Value = damageReceivingEntity }); ECB.AppendToBuffer(damageReceivingEntity, new DamageBufferElement { Value = damageOnTrigger.Value });
ECB.AppendToBuffer(damageDealingEntity, new AlreadyDamagedEntity { Value = damageReceivingEntity });
}
} }
} }
\ No newline at end of file
using Unity.Collections; using Unity.Collections;
using Unity.Entities; using Unity.Entities;
using Unity.Mathematics;
using Unity.NetCode; using Unity.NetCode;
using Unity.Transforms;
using UnityEngine; using UnityEngine;
...@@ -16,7 +14,6 @@ public partial struct ClientRequestGameEntrySystem : ISystem ...@@ -16,7 +14,6 @@ public partial struct ClientRequestGameEntrySystem : ISystem
.WithNone<NetworkStreamInGame>(); .WithNone<NetworkStreamInGame>();
state.RequireForUpdate(state.GetEntityQuery(entityQueryBuilder)); state.RequireForUpdate(state.GetEntityQuery(entityQueryBuilder));
entityQueryBuilder.Dispose(); entityQueryBuilder.Dispose();
state.RequireForUpdate<ClientConnectionRpc>();
} }
public void OnUpdate(ref SystemState state) public void OnUpdate(ref SystemState state)
...@@ -37,8 +34,8 @@ public partial struct ClientRequestGameEntrySystem : ISystem ...@@ -37,8 +34,8 @@ public partial struct ClientRequestGameEntrySystem : ISystem
FollowPlayer followScript = playerCameraGO.AddComponent<FollowPlayer>(); FollowPlayer followScript = playerCameraGO.AddComponent<FollowPlayer>();
followScript.networkId = networkId.ValueRO.Value; // Store networkId instead of dire followScript.networkId = networkId.ValueRO.Value; // Store networkId instead of dire
entityCommandBuffer.AddComponent(requestGameConnection, new GoInGameRequestRpc()); entityCommandBuffer.AddComponent<GoInGameRequestRpc>(requestGameConnection);
entityCommandBuffer.AddComponent(requestGameConnection, new SendRpcCommandRequest()); entityCommandBuffer.AddComponent<SendRpcCommandRequest>(requestGameConnection);
} }
entityCommandBuffer.Playback(state.EntityManager); entityCommandBuffer.Playback(state.EntityManager);
...@@ -55,7 +52,6 @@ public partial struct ThinClientRequestGameEntrySystem : ISystem ...@@ -55,7 +52,6 @@ public partial struct ThinClientRequestGameEntrySystem : ISystem
.WithNone<NetworkStreamInGame>(); .WithNone<NetworkStreamInGame>();
state.RequireForUpdate(state.GetEntityQuery(entityQueryBuilder)); state.RequireForUpdate(state.GetEntityQuery(entityQueryBuilder));
entityQueryBuilder.Dispose(); entityQueryBuilder.Dispose();
state.RequireForUpdate<ClientConnectionRpc>();
} }
public void OnUpdate(ref SystemState state) public void OnUpdate(ref SystemState state)
...@@ -72,8 +68,8 @@ public partial struct ThinClientRequestGameEntrySystem : ISystem ...@@ -72,8 +68,8 @@ public partial struct ThinClientRequestGameEntrySystem : ISystem
var requestGameConnection = entityCommandBuffer.CreateEntity(); var requestGameConnection = entityCommandBuffer.CreateEntity();
entityCommandBuffer.AddComponent(requestGameConnection, new GoInGameRequestRpc()); entityCommandBuffer.AddComponent<GoInGameRequestRpc>(requestGameConnection);
entityCommandBuffer.AddComponent(requestGameConnection, new SendRpcCommandRequest()); entityCommandBuffer.AddComponent<SendRpcCommandRequest>(requestGameConnection);
} }
entityCommandBuffer.Playback(state.EntityManager); entityCommandBuffer.Playback(state.EntityManager);
......
using System;
using Unity.Burst; using Unity.Burst;
using Unity.Collections;
using Unity.Entities; using Unity.Entities;
using Unity.NetCode;
partial struct ClientStartGameSystem : ISystem [WorldSystemFilter(WorldSystemFilterFlags.ClientSimulation)]
public partial class ClientStartGameSystem : SystemBase
{ {
[BurstCompile] public Action<int> OnUpdatePlayersRemainingToStart;
public void OnCreate(ref SystemState state) public Action OnStartGameCountdown;
{
}
[BurstCompile] protected override void OnUpdate()
public void OnUpdate(ref SystemState state)
{ {
var ecb = new EntityCommandBuffer(Allocator.Temp);
}
[BurstCompile] foreach (var (playersRemainingToStart, entity) in SystemAPI.Query<PlayersRemainingToStart>()
public void OnDestroy(ref SystemState state) .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.Burst;
using Unity.Collections; // using Unity.Collections;
using Unity.Entities; // using Unity.Entities;
using Unity.NetCode; // using Unity.NetCode;
using UnityEngine; // 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,17 +11,24 @@ partial struct GoInGameServerSystem : ISystem ...@@ -11,17 +11,24 @@ partial struct GoInGameServerSystem : ISystem
[BurstCompile] [BurstCompile]
public void OnCreate(ref SystemState state) public void OnCreate(ref SystemState state)
{ {
state.RequireForUpdate<NetworkTime>();
state.RequireForUpdate<GameStartProperties>();
state.RequireForUpdate<PlayerCounter>();
state.RequireForUpdate<EntititesReferences>(); state.RequireForUpdate<EntititesReferences>();
state.RequireForUpdate<NetworkId>(); state.RequireForUpdate<NetworkId>();
state.RequireForUpdate<GoInGameRequestRpc>(); state.RequireForUpdate<GoInGameRequestRpc>();
} }
[BurstCompile]
public void OnUpdate(ref SystemState state) public void OnUpdate(ref SystemState state)
{ {
EntityCommandBuffer entityCommandBuffer = new EntityCommandBuffer(Unity.Collections.Allocator.Temp); EntityCommandBuffer entityCommandBuffer = new EntityCommandBuffer(Unity.Collections.Allocator.Temp);
EntititesReferences entititesReferences = SystemAPI.GetSingleton<EntititesReferences>(); EntititesReferences entititesReferences = SystemAPI.GetSingleton<EntititesReferences>();
Entity gameStartPropertiesEntity = SystemAPI.GetSingletonEntity<GameStartProperties>();
PlayerCounter playerCounter = SystemAPI.GetComponent<PlayerCounter>(gameStartPropertiesEntity);
GameStartProperties gameStartProperties =
SystemAPI.GetComponent<GameStartProperties>(gameStartPropertiesEntity);
foreach (( foreach ((
RefRO<ReceiveRpcCommandRequest> receiveRpcCommandRequest, RefRO<ReceiveRpcCommandRequest> receiveRpcCommandRequest,
Entity entity) in Entity entity) in
...@@ -36,7 +43,7 @@ partial struct GoInGameServerSystem : ISystem ...@@ -36,7 +43,7 @@ partial struct GoInGameServerSystem : ISystem
// Instantiate player entity and place randomly on the x axis -+10 // 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( entityCommandBuffer.SetComponent(playerEntity, LocalTransform.FromPosition(new float3(
UnityEngine.Random.Range(-10, +10), 0, 0))); UnityEngine.Random.Range(-10, +10), 0, 0)));
...@@ -51,13 +58,40 @@ partial struct GoInGameServerSystem : ISystem ...@@ -51,13 +58,40 @@ partial struct GoInGameServerSystem : ISystem
{ {
Value = playerEntity 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); entityCommandBuffer.Playback(state.EntityManager);
} SystemAPI.SetSingleton(playerCounter);
[BurstCompile]
public void OnDestroy(ref SystemState state)
{
} }
} }
\ No newline at end of file
using Unity.Burst; using Unity.Burst;
using Unity.Collections;
using Unity.Entities; using Unity.Entities;
using Unity.NetCode;
[WorldSystemFilter(WorldSystemFilterFlags.ServerSimulation)]
partial struct ServerStartGameSystem : ISystem partial struct ServerStartGameSystem : ISystem
{ {
[BurstCompile]
public void OnCreate(ref SystemState state) public void OnCreate(ref SystemState state)
{ {
state.RequireForUpdate<NetworkTime>();
state.RequireForUpdate<GameStartProperties>();
state.RequireForUpdate<EntititesReferences>();
state.RequireForUpdate<GamePlayingTag>();
} }
}
[BurstCompile] \ No newline at end of file
public void OnUpdate(ref SystemState state)
{
}
[BurstCompile]
public void OnDestroy(ref SystemState state)
{
}
}
...@@ -49,10 +49,10 @@ public partial class RespawnPlayerSystem : SystemBase ...@@ -49,10 +49,10 @@ public partial class RespawnPlayerSystem : SystemBase
{ {
if (isServer) if (isServer)
{ {
var networkId = SystemAPI.GetComponent<NetworkId>(curRespawn.NetworkEntity).Value; int networkId = SystemAPI.GetComponent<NetworkId>(curRespawn.NetworkEntity).Value;
var playerPrefab = SystemAPI.GetSingleton<EntititesReferences>().playerPrefabEntity; Entity playerPrefab = SystemAPI.GetSingleton<EntititesReferences>().PlayerPrefabEntity;
var newPlayer = ecb.Instantiate(playerPrefab); Entity newPlayer = ecb.Instantiate(playerPrefab);
ecb.SetComponent(newPlayer, new GhostOwner { NetworkId = networkId }); ecb.SetComponent(newPlayer, new GhostOwner { NetworkId = networkId });
ecb.SetComponent(newPlayer, ecb.SetComponent(newPlayer,
......
fileFormatVersion: 2
guid: c8b061e7986968e4aa05ff889da5746a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using Unity.Entities;
using Unity.Entities.UniversalDelegates;
using UnityEngine;
public readonly partial struct EnemySpawnerAspect : IAspect
{
private readonly RefRW<EnemySpawnTimer> _enemySpawnTimer;
private readonly RefRO<GameStartProperties> _gameStartProperties;
private readonly RefRW<SpawnableEnemiesCounter> _spawnableEnemiesCounter;
public float TimeForNextSlimeSpawn
{
get => _enemySpawnTimer.ValueRO.SlimeSpawnTimer;
set => _enemySpawnTimer.ValueRW.SlimeSpawnTimer = value;
}
public float TimeForNextRogueSpawn
{
get => _enemySpawnTimer.ValueRO.RogueSpawnTimer;
set => _enemySpawnTimer.ValueRW.RogueSpawnTimer = value;
}
public float RandomSpawnOffset
{
get => _enemySpawnTimer.ValueRO.RandomSpawnOffset;
set => _enemySpawnTimer.ValueRW.RandomSpawnOffset = value;
}
public int RogueSpawnAmount => _gameStartProperties.ValueRO.RogueEnemyAmount;
public int SlimeSpawnAmount => _gameStartProperties.ValueRO.SlimeEnemyAmount;
public int RogueEnemyCounter
{
get => _spawnableEnemiesCounter.ValueRO.RogueEnemyCounter;
set => _spawnableEnemiesCounter.ValueRW.RogueEnemyCounter = value;
}
public int SlimeEnemyCounter
{
get => _spawnableEnemiesCounter.ValueRO.SlimeEnemyCounter;
set => _spawnableEnemiesCounter.ValueRW.SlimeEnemyCounter = value;
}
public float SlimeSpawnCoolDown => _enemySpawnTimer.ValueRO.SlimeSpawnCooldown;
public float RogueSpawnCoolDown => _enemySpawnTimer.ValueRO.RogueSpawnCooldown;
public bool CanEnemySlimeSpawn => TimeForNextSlimeSpawn <= 0 && SlimeSpawnAmount > SlimeEnemyCounter;
public bool CanEnemyRogueSpawn => TimeForNextRogueSpawn <= 0 && RogueSpawnAmount > RogueEnemyCounter;
public void DecrementTimers(float deltaTime)
{
TimeForNextSlimeSpawn -= deltaTime;
TimeForNextRogueSpawn -= deltaTime;
if (RandomSpawnOffset > -5)
RandomSpawnOffset -= deltaTime;
else
RandomSpawnOffset = 5f;
}
public void IncreaseSlimeCounter()
{
SlimeEnemyCounter++;
}
public void IncreaseRogueCounter()
{
RogueEnemyCounter++;
}
public void ResetRoqueTimer()
{
TimeForNextRogueSpawn = RogueSpawnCoolDown;
}
public void ResetSlimeTimer()
{
TimeForNextSlimeSpawn = SlimeSpawnCoolDown;
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: bbc590dcb6bb2af43893d7116bb3c233
\ No newline at end of file
using Unity.Burst;
using Unity.Entities;
using Unity.Mathematics;
using Unity.Physics;
using Unity.Transforms;
using UnityEngine;
[WorldSystemFilter(WorldSystemFilterFlags.ServerSimulation)]
partial struct EnemySpawnerSystem : ISystem
{
public void OnCreate(ref SystemState state)
{
state.RequireForUpdate<GamePlayingTag>();
state.RequireForUpdate<EnemySpawnPoints>();
state.RequireForUpdate<EnemySpawnTimer>();
state.RequireForUpdate<EntititesReferences>();
state.RequireForUpdate<BeginSimulationEntityCommandBufferSystem.Singleton>();
}
[BurstCompile]
public void OnUpdate(ref SystemState state)
{
var deltaTime = SystemAPI.Time.DeltaTime;
Entity enemyPropertiesEntity = SystemAPI.GetSingletonEntity<EnemySpawnPoints>();
DynamicBuffer<EnemySpawnPoints> spawnPoints = SystemAPI.GetBuffer<EnemySpawnPoints>(enemyPropertiesEntity);
var ecbSingleton = SystemAPI.GetSingleton<BeginSimulationEntityCommandBufferSystem.Singleton>();
var ecb = ecbSingleton.CreateCommandBuffer(state.WorldUnmanaged);
foreach (var aspect in SystemAPI.Query<EnemySpawnerAspect>())
{
aspect.DecrementTimers(deltaTime);
if (aspect.CanEnemySlimeSpawn)
{
Entity enemySlimeEntity = SystemAPI.GetSingleton<EntititesReferences>().SlimeEnemyEntity;
int slimeSpawnIndex = aspect.SlimeEnemyCounter % spawnPoints.Length;
float randomValue = aspect.RandomSpawnOffset;
float3 spawnPosition =
spawnPoints[slimeSpawnIndex].SpawnPoint + new float3(randomValue, 0, -randomValue);
SpawnEnemy(ecb, enemySlimeEntity, spawnPosition);
aspect.IncreaseSlimeCounter();
aspect.ResetSlimeTimer();
}
if (aspect.CanEnemyRogueSpawn)
{
Entity enemyRogueEntity = SystemAPI.GetSingleton<EntititesReferences>().RougeEnemyEntity;
int rogueSpawnIndex = aspect.RogueEnemyCounter % spawnPoints.Length;
float randomValue = aspect.RandomSpawnOffset;
float3 spawnPosition =
spawnPoints[rogueSpawnIndex].SpawnPoint + new float3(randomValue, 0, -randomValue);
SpawnEnemy(ecb, enemyRogueEntity, spawnPosition);
aspect.IncreaseRogueCounter();
aspect.ResetRoqueTimer();
}
}
}
void SpawnEnemy(EntityCommandBuffer ecb, Entity spawnableEntity, float3 position)
{
Entity newEnemy = ecb.Instantiate(spawnableEntity);
ecb.SetComponent(newEnemy,
LocalTransform.FromPosition(position));
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: f15af634b55d47044993c2bcae7811ba
\ No newline at end of file
...@@ -15,7 +15,14 @@ public class ClientConnectionManager : MonoBehaviour ...@@ -15,7 +15,14 @@ public class ClientConnectionManager : MonoBehaviour
[SerializeField] private TMP_InputField _playerAmountField; [SerializeField] private TMP_InputField _playerAmountField;
[SerializeField] private TMP_InputField _RogueEnemyAmountField; [SerializeField] private TMP_InputField _RogueEnemyAmountField;
[SerializeField] private TMP_InputField _SlimeEnemyAmountField; [SerializeField] private TMP_InputField _SlimeEnemyAmountField;
[SerializeField] private GameObject LobbyAmountContainer;
[SerializeField] private GameObject RangerAmountContainer;
[SerializeField] private GameObject SlimeAmountContainer;
[SerializeField] private Button _connectButton; [SerializeField] private Button _connectButton;
[SerializeField] private int _gameStartCountDownTime;
[SerializeField] private float _slimeSpawnCooldownTime;
[SerializeField] private float _rogueSpawnCooldownTime;
private ushort Port => ushort.Parse(_portField.text); private ushort Port => ushort.Parse(_portField.text);
private int PlayerAmount => int.Parse(_playerAmountField.text); private int PlayerAmount => int.Parse(_playerAmountField.text);
...@@ -45,12 +52,15 @@ public class ClientConnectionManager : MonoBehaviour ...@@ -45,12 +52,15 @@ public class ClientConnectionManager : MonoBehaviour
{ {
case 0: case 0:
buttonLabel = "Start Host"; buttonLabel = "Start Host";
LobbyAmountContainer.SetActive(true);
RangerAmountContainer.SetActive(true);
SlimeAmountContainer.SetActive(true);
break; break;
case 1: case 1:
buttonLabel = "Start Server";
break;
case 2:
buttonLabel = "Start Client"; buttonLabel = "Start Client";
LobbyAmountContainer.SetActive(false);
RangerAmountContainer.SetActive(false);
SlimeAmountContainer.SetActive(false);
break; break;
default: default:
buttonLabel = "<ERROR>"; buttonLabel = "<ERROR>";
...@@ -62,6 +72,7 @@ public class ClientConnectionManager : MonoBehaviour ...@@ -62,6 +72,7 @@ public class ClientConnectionManager : MonoBehaviour
buttonText.text = buttonLabel; buttonText.text = buttonLabel;
} }
private void OnButtonConnect() private void OnButtonConnect()
{ {
DestroyLocalSimulationWorld(); DestroyLocalSimulationWorld();
...@@ -74,9 +85,6 @@ public class ClientConnectionManager : MonoBehaviour ...@@ -74,9 +85,6 @@ public class ClientConnectionManager : MonoBehaviour
StartClient(); StartClient();
break; break;
case 1: case 1:
StartServer();
break;
case 2:
StartClient(); StartClient();
break; break;
default: default:
...@@ -107,14 +115,26 @@ public class ClientConnectionManager : MonoBehaviour ...@@ -107,14 +115,26 @@ public class ClientConnectionManager : MonoBehaviour
serverWorld.EntityManager.CreateEntityQuery(ComponentType.ReadWrite<NetworkStreamDriver>()); serverWorld.EntityManager.CreateEntityQuery(ComponentType.ReadWrite<NetworkStreamDriver>());
networkDriverQuery.GetSingletonRW<NetworkStreamDriver>().ValueRW.Listen(serverEndpoint); networkDriverQuery.GetSingletonRW<NetworkStreamDriver>().ValueRW.Listen(serverEndpoint);
} }
var enemyAmountEntity = serverWorld.EntityManager.CreateEntity();
serverWorld.EntityManager.AddComponentData(enemyAmountEntity, new EnemyAmountRpc var spawnerEntity = serverWorld.EntityManager.CreateEntity();
serverWorld.EntityManager.AddComponentData(spawnerEntity, new GameStartProperties
{ {
CountdownTime = _gameStartCountDownTime,
PlayerAmount = PlayerAmount, PlayerAmount = PlayerAmount,
RogueEnemyAmount = RogueEnemyAmount, RogueEnemyAmount = RogueEnemyAmount,
SlimeEnemyAmount = SlimeEnemyAmount SlimeEnemyAmount = SlimeEnemyAmount
}); });
serverWorld.EntityManager.AddComponentData(spawnerEntity, new EnemySpawnTimer
{
SlimeSpawnCooldown = _slimeSpawnCooldownTime,
RogueSpawnCooldown = _rogueSpawnCooldownTime
});
serverWorld.EntityManager.AddComponentData(spawnerEntity, new SpawnableEnemiesCounter
{
SlimeEnemyCounter = 0,
RogueEnemyCounter = 0
});
serverWorld.EntityManager.AddComponentData(spawnerEntity, new PlayerCounter { Value = 0 });
} }
private void StartClient() 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: ...@@ -1285,7 +1285,7 @@ MonoBehaviour:
m_OnCullStateChanged: m_OnCullStateChanged:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
m_text: "7979\u200B" m_text: "1\u200B"
m_isRightToLeft: 0 m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
...@@ -1421,7 +1421,7 @@ MonoBehaviour: ...@@ -1421,7 +1421,7 @@ MonoBehaviour:
m_OnCullStateChanged: m_OnCullStateChanged:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
m_text: Ranger Enemy m_text: 'Ranger Amount:'
m_isRightToLeft: 0 m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
...@@ -1557,7 +1557,7 @@ MonoBehaviour: ...@@ -1557,7 +1557,7 @@ MonoBehaviour:
m_OnCullStateChanged: m_OnCullStateChanged:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
m_text: 'Connection Port:' m_text: 'Slime Amount:'
m_isRightToLeft: 0 m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
...@@ -2178,9 +2178,6 @@ MonoBehaviour: ...@@ -2178,9 +2178,6 @@ MonoBehaviour:
- m_Text: Host (Client + Server) - m_Text: Host (Client + Server)
m_Image: {fileID: 0} m_Image: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1} 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_Text: Client (Client Only)
m_Image: {fileID: 0} m_Image: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
...@@ -2625,7 +2622,7 @@ MonoBehaviour: ...@@ -2625,7 +2622,7 @@ MonoBehaviour:
m_OnCullStateChanged: m_OnCullStateChanged:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
m_text: "7979\u200B" m_text: "100\u200B"
m_isRightToLeft: 0 m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
...@@ -2709,7 +2706,7 @@ GameObject: ...@@ -2709,7 +2706,7 @@ GameObject:
- component: {fileID: 7879318744620076301} - component: {fileID: 7879318744620076301}
- component: {fileID: 3534326167216121825} - component: {fileID: 3534326167216121825}
m_Layer: 5 m_Layer: 5
m_Name: PortInputField (TMP) m_Name: PlayerInputField (TMP)
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
...@@ -2859,7 +2856,7 @@ MonoBehaviour: ...@@ -2859,7 +2856,7 @@ MonoBehaviour:
m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_CustomCaretColor: 0 m_CustomCaretColor: 0
m_SelectionColor: {r: 0.65882355, g: 0.80784315, b: 1, a: 0.7529412} m_SelectionColor: {r: 0.65882355, g: 0.80784315, b: 1, a: 0.7529412}
m_Text: 7979 m_Text: 1
m_CaretBlinkRate: 0.85 m_CaretBlinkRate: 0.85
m_CaretWidth: 1 m_CaretWidth: 1
m_ReadOnly: 0 m_ReadOnly: 0
...@@ -3003,7 +3000,7 @@ MonoBehaviour: ...@@ -3003,7 +3000,7 @@ MonoBehaviour:
m_OnCullStateChanged: m_OnCullStateChanged:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
m_text: "7979\u200B" m_text: "10\u200B"
m_isRightToLeft: 0 m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
...@@ -3214,7 +3211,7 @@ GameObject: ...@@ -3214,7 +3211,7 @@ GameObject:
- component: {fileID: 7912536268569717590} - component: {fileID: 7912536268569717590}
- component: {fileID: 8650075725555599494} - component: {fileID: 8650075725555599494}
m_Layer: 5 m_Layer: 5
m_Name: PortInputField (TMP) m_Name: RangerInputField (TMP)
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
...@@ -3364,7 +3361,7 @@ MonoBehaviour: ...@@ -3364,7 +3361,7 @@ MonoBehaviour:
m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_CustomCaretColor: 0 m_CustomCaretColor: 0
m_SelectionColor: {r: 0.65882355, g: 0.80784315, b: 1, a: 0.7529412} m_SelectionColor: {r: 0.65882355, g: 0.80784315, b: 1, a: 0.7529412}
m_Text: 7979 m_Text: 10
m_CaretBlinkRate: 0.85 m_CaretBlinkRate: 0.85
m_CaretWidth: 1 m_CaretWidth: 1
m_ReadOnly: 0 m_ReadOnly: 0
...@@ -4640,7 +4637,7 @@ GameObject: ...@@ -4640,7 +4637,7 @@ GameObject:
- component: {fileID: 1920909873846200060} - component: {fileID: 1920909873846200060}
- component: {fileID: 5105218363004495263} - component: {fileID: 5105218363004495263}
m_Layer: 5 m_Layer: 5
m_Name: PortInputField (TMP) m_Name: SlimeInputField (TMP)
m_TagString: Untagged m_TagString: Untagged
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
...@@ -4790,7 +4787,7 @@ MonoBehaviour: ...@@ -4790,7 +4787,7 @@ MonoBehaviour:
m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_CustomCaretColor: 0 m_CustomCaretColor: 0
m_SelectionColor: {r: 0.65882355, g: 0.80784315, b: 1, a: 0.7529412} m_SelectionColor: {r: 0.65882355, g: 0.80784315, b: 1, a: 0.7529412}
m_Text: 7979 m_Text: 100
m_CaretBlinkRate: 0.85 m_CaretBlinkRate: 0.85
m_CaretWidth: 1 m_CaretWidth: 1
m_ReadOnly: 0 m_ReadOnly: 0
......
...@@ -89,7 +89,7 @@ MonoBehaviour: ...@@ -89,7 +89,7 @@ MonoBehaviour:
m_Template: {fileID: 0} m_Template: {fileID: 0}
m_CollisionResponse: m_CollisionResponse:
m_Override: 0 m_Override: 0
m_Value: 3 m_Value: 1
m_Friction: m_Friction:
m_Override: 0 m_Override: 0
m_Value: m_Value:
......
...@@ -11,12 +11,12 @@ GameObject: ...@@ -11,12 +11,12 @@ GameObject:
- component: {fileID: 108378693547780218} - component: {fileID: 108378693547780218}
- component: {fileID: -1646835149202598146} - component: {fileID: -1646835149202598146}
- component: {fileID: -202488746562016087} - component: {fileID: -202488746562016087}
- component: {fileID: -6588502853141303043}
- component: {fileID: -4296278104235172521} - component: {fileID: -4296278104235172521}
- component: {fileID: 7946462240341238627} - component: {fileID: 7946462240341238627}
- component: {fileID: -8527907258641966621} - component: {fileID: -8527907258641966621}
- component: {fileID: 4127881285066043338} - component: {fileID: 4127881285066043338}
- component: {fileID: -274669407858188047} - component: {fileID: -274669407858188047}
- component: {fileID: -5213069575148900343}
m_Layer: 0 m_Layer: 0
m_Name: Cube m_Name: Cube
m_TagString: Untagged m_TagString: Untagged
...@@ -77,33 +77,6 @@ MonoBehaviour: ...@@ -77,33 +77,6 @@ MonoBehaviour:
UsePreSerialization: 0 UsePreSerialization: 0
RollbackPredictedSpawnedGhostState: 0 RollbackPredictedSpawnedGhostState: 0
RollbackPredictionOnStructuralChanges: 1 RollbackPredictionOnStructuralChanges: 1
--- !u!54 &-6588502853141303043
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2899838405596494908}
serializedVersion: 4
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_CenterOfMass: {x: 0, y: 0, z: 0}
m_InertiaTensor: {x: 1, y: 1, z: 1}
m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_ImplicitCom: 1
m_ImplicitTensor: 1
m_UseGravity: 0
m_IsKinematic: 1
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!114 &-4296278104235172521 --- !u!114 &-4296278104235172521
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -157,7 +130,7 @@ MonoBehaviour: ...@@ -157,7 +130,7 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
NpcTargetRadius: 15 NpcTargetRadius: 15
AttackCooldownTime: 2 AttackCooldownTime: 2
NetCodeConfig: {fileID: 11400000, guid: cd69de227738309429193c9089949c16, type: 2} NetCodeConfig: {fileID: 11400000, guid: edda5bd0f33a95e4a98f780e0e3ae9e8, type: 2}
--- !u!114 &-274669407858188047 --- !u!114 &-274669407858188047
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -173,7 +146,7 @@ MonoBehaviour: ...@@ -173,7 +146,7 @@ MonoBehaviour:
m_ShapeType: 0 m_ShapeType: 0
m_PrimitiveCenter: m_PrimitiveCenter:
x: 0 x: 0
y: 0 y: 0.6000001
z: 0 z: 0
m_PrimitiveSize: m_PrimitiveSize:
x: 1 x: 1
...@@ -188,7 +161,7 @@ MonoBehaviour: ...@@ -188,7 +161,7 @@ MonoBehaviour:
m_Capsule: m_Capsule:
Height: 1 Height: 1
Radius: 0.5 Radius: 0.5
Axis: 2 Axis: 0
m_Cylinder: m_Cylinder:
Height: 1 Height: 1
Radius: 0.5 Radius: 0.5
...@@ -207,7 +180,7 @@ MonoBehaviour: ...@@ -207,7 +180,7 @@ MonoBehaviour:
m_Template: {fileID: 0} m_Template: {fileID: 0}
m_CollisionResponse: m_CollisionResponse:
m_Override: 0 m_Override: 0
m_Value: 3 m_Value: 1
m_Friction: m_Friction:
m_Override: 0 m_Override: 0
m_Value: m_Value:
...@@ -256,7 +229,7 @@ MonoBehaviour: ...@@ -256,7 +229,7 @@ MonoBehaviour:
m_CollidesWithCategories: m_CollidesWithCategories:
m_Override: 0 m_Override: 0
m_Value: m_Value:
Category00: 0 Category00: 1
Category01: 1 Category01: 1
Category02: 1 Category02: 1
Category03: 0 Category03: 0
...@@ -301,6 +274,33 @@ MonoBehaviour: ...@@ -301,6 +274,33 @@ MonoBehaviour:
Tag07: 0 Tag07: 0
m_SerializedVersion: 1 m_SerializedVersion: 1
m_SerializedVersion: 1 m_SerializedVersion: 1
--- !u!54 &-5213069575148900343
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2899838405596494908}
serializedVersion: 4
m_Mass: 5.05
m_Drag: 0
m_AngularDrag: 0.05
m_CenterOfMass: {x: 0, y: 0, z: 0}
m_InertiaTensor: {x: 1, y: 1, z: 1}
m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_ImplicitCom: 1
m_ImplicitTensor: 1
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 112
m_CollisionDetection: 0
--- !u!1 &7494803013719323330 --- !u!1 &7494803013719323330
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
......
...@@ -104,7 +104,7 @@ MonoBehaviour: ...@@ -104,7 +104,7 @@ MonoBehaviour:
AttackCooldownTime: 2 AttackCooldownTime: 2
FirePointOffset: {x: 0, y: 1.5, z: 0} FirePointOffset: {x: 0, y: 1.5, z: 0}
AttackPrefab: {fileID: 357967689053387235, guid: 19127a4c1ac11844db4373b9e147918b, type: 3} AttackPrefab: {fileID: 357967689053387235, guid: 19127a4c1ac11844db4373b9e147918b, type: 3}
NetCodeConfig: {fileID: 11400000, guid: cd69de227738309429193c9089949c16, type: 2} NetCodeConfig: {fileID: 11400000, guid: edda5bd0f33a95e4a98f780e0e3ae9e8, type: 2}
--- !u!114 &7330549200574829686 --- !u!114 &7330549200574829686
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
......
...@@ -68,8 +68,40 @@ Transform: ...@@ -68,8 +68,40 @@ Transform:
- {fileID: 5001222007940412494} - {fileID: 5001222007940412494}
- {fileID: 5581542974833947271} - {fileID: 5581542974833947271}
- {fileID: 5981432708657565925} - {fileID: 5981432708657565925}
- {fileID: 1389336659677476459}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &988906693792640195
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4113111654433410427}
m_Layer: 0
m_Name: EnemySpawnPosition (3)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4113111654433410427
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 988906693792640195}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 17.1, y: 0, z: 17}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1389336659677476459}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1342101318069946295 --- !u!1 &1342101318069946295
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -101,6 +133,99 @@ Transform: ...@@ -101,6 +133,99 @@ Transform:
m_Children: [] m_Children: []
m_Father: {fileID: 3251327355353088423} m_Father: {fileID: 3251327355353088423}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1375083077691249541
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2470590900687131865}
m_Layer: 0
m_Name: EnemySpawnPosition
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2470590900687131865
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1375083077691249541}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -22.8, y: 0, z: -23.7}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1389336659677476459}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2728779988751634932
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4897543871710356616}
m_Layer: 0
m_Name: EnemySpawnPosition (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4897543871710356616
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2728779988751634932}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -23.4, y: 0, z: 18.6}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1389336659677476459}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2897969905478238021
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2185406100811654051}
m_Layer: 0
m_Name: EnemySpawnPosition (2)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2185406100811654051
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2897969905478238021}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 16.7, y: 0, z: -20.8}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1389336659677476459}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &5250389714568146909 --- !u!1 &5250389714568146909
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -282,6 +407,41 @@ Transform: ...@@ -282,6 +407,41 @@ Transform:
m_Children: [] m_Children: []
m_Father: {fileID: 3251327355353088423} m_Father: {fileID: 3251327355353088423}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &8303283688989544350
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1389336659677476459}
m_Layer: 0
m_Name: EnemySpawnPositions
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1389336659677476459
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8303283688989544350}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2470590900687131865}
- {fileID: 4897543871710356616}
- {fileID: 2185406100811654051}
- {fileID: 4113111654433410427}
m_Father: {fileID: 3251327355353088423}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &706217386485487288 --- !u!1001 &706217386485487288
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
......
...@@ -320,7 +320,7 @@ MonoBehaviour: ...@@ -320,7 +320,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8e73c985659b81d408f4e99cb152349d, type: 3} m_Script: {fileID: 11500000, guid: 8e73c985659b81d408f4e99cb152349d, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
MaxHitPoints: 500 MaxHitPoints: 20000
--- !u!1001 &6975352639711469968 --- !u!1001 &6975352639711469968
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -376,40 +376,10 @@ PrefabInstance: ...@@ -376,40 +376,10 @@ PrefabInstance:
m_RemovedComponents: [] m_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: m_AddedComponents: []
- targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: e8747e16efffd7a47afd2563a3a381bd, type: 3}
insertIndex: -1
addedObject: {fileID: 6927830130995102561}
m_SourcePrefab: {fileID: 100100000, guid: e8747e16efffd7a47afd2563a3a381bd, type: 3} m_SourcePrefab: {fileID: 100100000, guid: e8747e16efffd7a47afd2563a3a381bd, type: 3}
--- !u!4 &7442153552013198971 stripped --- !u!4 &7442153552013198971 stripped
Transform: Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: e8747e16efffd7a47afd2563a3a381bd, type: 3} m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: e8747e16efffd7a47afd2563a3a381bd, type: 3}
m_PrefabInstance: {fileID: 6975352639711469968} m_PrefabInstance: {fileID: 6975352639711469968}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!1 &7785606193239088321 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: e8747e16efffd7a47afd2563a3a381bd, type: 3}
m_PrefabInstance: {fileID: 6975352639711469968}
m_PrefabAsset: {fileID: 0}
--- !u!95 &6927830130995102561
Animator:
serializedVersion: 7
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7785606193239088321}
m_Enabled: 1
m_Avatar: {fileID: 9000000, guid: e8747e16efffd7a47afd2563a3a381bd, type: 3}
m_Controller: {fileID: 9100000, guid: d51e64459114ce740bd0867a7eca5623, type: 2}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_StabilizeFeet: 0
m_AnimatePhysics: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorStateOnDisable: 0
m_WriteDefaultValuesOnDisable: 0
...@@ -63,7 +63,7 @@ MonoBehaviour: ...@@ -63,7 +63,7 @@ MonoBehaviour:
OptimizationMode: 0 OptimizationMode: 0
Importance: 10 Importance: 10
MaxSendRate: 0 MaxSendRate: 0
prefabId: prefabId: d6f706ad9a658e94aa7285ff9d26c638
HasOwner: 0 HasOwner: 0
SupportAutoCommandTarget: 1 SupportAutoCommandTarget: 1
TrackInterpolationDelay: 0 TrackInterpolationDelay: 0
...@@ -84,4 +84,4 @@ MonoBehaviour: ...@@ -84,4 +84,4 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
RespawnTime: 10 RespawnTime: 10
NetCodeConfig: {fileID: 11400000, guid: cd69de227738309429193c9089949c16, type: 2} NetCodeConfig: {fileID: 11400000, guid: edda5bd0f33a95e4a98f780e0e3ae9e8, type: 2}
...@@ -119,6 +119,17 @@ NavMeshSettings: ...@@ -119,6 +119,17 @@ NavMeshSettings:
debug: debug:
m_Flags: 0 m_Flags: 0
m_NavMeshData: {fileID: 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 --- !u!1 &167584907
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -471,8 +482,38 @@ MonoBehaviour: ...@@ -471,8 +482,38 @@ MonoBehaviour:
_addressField: {fileID: 393054154} _addressField: {fileID: 393054154}
_portField: {fileID: 723240685} _portField: {fileID: 723240685}
_connectionModeDropdown: {fileID: 746543760} _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} _connectButton: {fileID: 661734915}
_gameStartCountDownTime: 2
_slimeSpawnCooldownTime: 0.3
_rogueSpawnCooldownTime: 1
--- !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 --- !u!1001 &7438304585132253660
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -589,10 +630,6 @@ PrefabInstance: ...@@ -589,10 +630,6 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: 0 value: 0
objectReference: {fileID: 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} - target: {fileID: 3040996727634378079, guid: 72327351aa28fbe4fb4c16c3d17e4de5, type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
value: 0 value: 0
...@@ -685,10 +722,6 @@ PrefabInstance: ...@@ -685,10 +722,6 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: 0 value: 0
objectReference: {fileID: 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} - target: {fileID: 5331613406234217351, guid: 72327351aa28fbe4fb4c16c3d17e4de5, type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
value: 0 value: 0
...@@ -737,10 +770,6 @@ PrefabInstance: ...@@ -737,10 +770,6 @@ PrefabInstance:
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: 0 value: 0
objectReference: {fileID: 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} - target: {fileID: 5897803869160389310, guid: 72327351aa28fbe4fb4c16c3d17e4de5, type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
value: 0 value: 0
...@@ -857,10 +886,6 @@ PrefabInstance: ...@@ -857,10 +886,6 @@ PrefabInstance:
propertyPath: m_SizeDelta.y propertyPath: m_SizeDelta.y
value: 0 value: 0
objectReference: {fileID: 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} - target: {fileID: 8875326252354947531, guid: 72327351aa28fbe4fb4c16c3d17e4de5, type: 3}
propertyPath: m_Pivot.x propertyPath: m_Pivot.x
value: 0 value: 0
...@@ -946,6 +971,21 @@ PrefabInstance: ...@@ -946,6 +971,21 @@ PrefabInstance:
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: [] m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 72327351aa28fbe4fb4c16c3d17e4de5, type: 3} 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 --- !u!1660057539 &9223372036854775807
SceneRoots: SceneRoots:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
......
...@@ -380,18 +380,10 @@ PrefabInstance: ...@@ -380,18 +380,10 @@ PrefabInstance:
propertyPath: m_Name propertyPath: m_Name
value: HUDCanvas value: HUDCanvas
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1033715538230118892, guid: dc695439125c44a4190bdc008aa5a0fc, type: 3} - target: {fileID: 1792365681371560561, guid: dc695439125c44a4190bdc008aa5a0fc, type: 3}
propertyPath: 'm_ActiveFontFeatures.Array.data[0]'
value: 1801810542
objectReference: {fileID: 0}
- target: {fileID: 1796973617372691604, guid: dc695439125c44a4190bdc008aa5a0fc, type: 3}
propertyPath: m_Enabled propertyPath: m_Enabled
value: 1 value: 1
objectReference: {fileID: 0} 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} - target: {fileID: 2274541876267278006, guid: dc695439125c44a4190bdc008aa5a0fc, type: 3}
propertyPath: m_Pivot.x propertyPath: m_Pivot.x
value: 0 value: 0
...@@ -472,38 +464,8 @@ PrefabInstance: ...@@ -472,38 +464,8 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 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_RemovedComponents: []
m_RemovedGameObjects: m_RemovedGameObjects: []
- {fileID: 4776685628420966923, guid: dc695439125c44a4190bdc008aa5a0fc, type: 3}
- {fileID: 6766818103523215656, guid: dc695439125c44a4190bdc008aa5a0fc, type: 3}
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: [] m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: dc695439125c44a4190bdc008aa5a0fc, type: 3} m_SourcePrefab: {fileID: 100100000, guid: dc695439125c44a4190bdc008aa5a0fc, type: 3}
......
...@@ -58,7 +58,7 @@ GraphicsSettings: ...@@ -58,7 +58,7 @@ GraphicsSettings:
m_FogKeepExp2: 1 m_FogKeepExp2: 1
m_AlbedoSwatchInfos: [] m_AlbedoSwatchInfos: []
m_RenderPipelineGlobalSettingsMap: m_RenderPipelineGlobalSettingsMap:
UnityEngine.Rendering.Universal.UniversalRenderPipeline: {fileID: 11400000, guid: 18dc0cd2c080841dea60987a38ce93fa, type: 2} UnityEngine.Rendering.Universal.UniversalRenderPipeline: {fileID: 11400000, guid: bda2f1b023323c34c8b930f637e07a0e, type: 2}
m_LightsUseLinearIntensity: 1 m_LightsUseLinearIntensity: 1
m_LightsUseColorTemperature: 1 m_LightsUseColorTemperature: 1
m_LogWhenShaderIsCompiled: 0 m_LogWhenShaderIsCompiled: 0
......
...@@ -15,7 +15,7 @@ MonoBehaviour: ...@@ -15,7 +15,7 @@ MonoBehaviour:
FilterSettings: FilterSettings:
ExcludedBakingSystemAssemblies: [] ExcludedBakingSystemAssemblies: []
AdditionalScriptingDefines: [] AdditionalScriptingDefines: []
GlobalNetCodeConfig: {fileID: 0} GlobalNetCodeConfig: {fileID: 11400000, guid: edda5bd0f33a95e4a98f780e0e3ae9e8, type: 2}
CurrentImportanceSuggestions: CurrentImportanceSuggestions:
- MinValue: 1 - MinValue: 1
MaxValue: 4 MaxValue: 4
......
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &1
MonoBehaviour:
m_ObjectHideFlags: 53
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a287be6c49135cd4f9b2b8666c39d999, type: 3}
m_Name:
m_EditorClassIdentifier:
assetDefaultFramerate: 60
m_DefaultFrameRate: 60
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