From ad238ac417a4420da77b9162d7cc18dee690411f Mon Sep 17 00:00:00 2001 From: juliuse98 Date: Fri, 19 Nov 2021 14:42:09 +0100 Subject: [PATCH] Added Round and Respawnsystem --- Assets/Prefabs/DefrainNetworking.meta | 8 + .../DefrainNetworking/MatchController.prefab | 116 +++++ .../MatchController.prefab.meta | 7 + .../DefrainNetworking/NetworkManager.prefab | 102 +++++ .../NetworkManager.prefab.meta | 7 + Assets/Prefabs/Networing/GameManager.prefab | 32 ++ .../Player/Player Animation Test.prefab | 48 +- Assets/Scenes/TestScene.unity | 432 +++++++++++++++--- Assets/Scripts/DefrainNetworking.meta | 8 + .../DefrainSpawnController.cs | 61 +++ .../DefrainSpawnController.cs.meta | 11 + .../GameManager/DefrainNetworkManager.cs | 248 ++++++++++ .../GameManager/DefrainNetworkManager.cs.meta | 11 + Assets/Scripts/GameManager/GameMaster.cs | 71 ++- Assets/Scripts/GameManager/SpawnController.cs | 39 ++ .../GameManager/SpawnController.cs.meta | 11 + Assets/Scripts/GameManager/Spawnpoint.cs | 34 ++ Assets/Scripts/GameManager/Spawnpoint.cs.meta | 11 + Assets/Scripts/GameManager/Team.cs | 31 +- Assets/Scripts/GameManager/TeamManager.cs | 49 ++ .../Scripts/GameManager/TeamManager.cs.meta | 11 + Assets/Scripts/Player/Player.cs | 47 +- Assets/Scripts/Player/PlayerController.cs | 2 +- Assets/Scripts/Weapons/Shoot.cs | 2 - Assets/Scripts/Yeet.cs | 61 +++ Assets/Scripts/Yeet.cs.meta | 11 + UserSettings/Layouts/default-2021.dwlt | 168 +++---- 27 files changed, 1451 insertions(+), 188 deletions(-) create mode 100644 Assets/Prefabs/DefrainNetworking.meta create mode 100644 Assets/Prefabs/DefrainNetworking/MatchController.prefab create mode 100644 Assets/Prefabs/DefrainNetworking/MatchController.prefab.meta create mode 100644 Assets/Prefabs/DefrainNetworking/NetworkManager.prefab create mode 100644 Assets/Prefabs/DefrainNetworking/NetworkManager.prefab.meta create mode 100644 Assets/Scripts/DefrainNetworking.meta create mode 100644 Assets/Scripts/DefrainNetworking/DefrainSpawnController.cs create mode 100644 Assets/Scripts/DefrainNetworking/DefrainSpawnController.cs.meta create mode 100644 Assets/Scripts/GameManager/DefrainNetworkManager.cs create mode 100644 Assets/Scripts/GameManager/DefrainNetworkManager.cs.meta create mode 100644 Assets/Scripts/GameManager/SpawnController.cs create mode 100644 Assets/Scripts/GameManager/SpawnController.cs.meta create mode 100644 Assets/Scripts/GameManager/Spawnpoint.cs create mode 100644 Assets/Scripts/GameManager/Spawnpoint.cs.meta create mode 100644 Assets/Scripts/GameManager/TeamManager.cs create mode 100644 Assets/Scripts/GameManager/TeamManager.cs.meta create mode 100644 Assets/Scripts/Yeet.cs create mode 100644 Assets/Scripts/Yeet.cs.meta diff --git a/Assets/Prefabs/DefrainNetworking.meta b/Assets/Prefabs/DefrainNetworking.meta new file mode 100644 index 0000000..fc9f4b5 --- /dev/null +++ b/Assets/Prefabs/DefrainNetworking.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 311691f34c0cdbf4eb81e33281e976ac +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/DefrainNetworking/MatchController.prefab b/Assets/Prefabs/DefrainNetworking/MatchController.prefab new file mode 100644 index 0000000..7eb11d4 --- /dev/null +++ b/Assets/Prefabs/DefrainNetworking/MatchController.prefab @@ -0,0 +1,116 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &3974865484676985655 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2849906635484503724} + - component: {fileID: 2655719566820584133} + - component: {fileID: 6296881644358387443} + - component: {fileID: 230145199} + - component: {fileID: 230145200} + - component: {fileID: 230145201} + m_Layer: 0 + m_Name: MatchController + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2849906635484503724 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3974865484676985655} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 3.4827125, y: 2.271285, z: 6.642964} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2655719566820584133 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3974865484676985655} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9b91ecbcc199f4492b9a91e820070131, type: 3} + m_Name: + m_EditorClassIdentifier: + sceneId: 0 + serverOnly: 0 + visible: 0 + m_AssetId: f0c1bca3291086d449266d9ed8942180 + hasSpawned: 0 +--- !u!114 &6296881644358387443 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3974865484676985655} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: a57722a4a9f575b46b99d60d2d9eb2bf, type: 3} + m_Name: + m_EditorClassIdentifier: + syncMode: 0 + syncInterval: 0.1 +--- !u!114 &230145199 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3974865484676985655} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cc117181a5e845145888b1c152bcb4ad, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &230145200 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3974865484676985655} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4449624fc82d6174f85b2f83bbfa91f8, type: 3} + m_Name: + m_EditorClassIdentifier: + availableSpawns: + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} +--- !u!114 &230145201 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3974865484676985655} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 26ee7b094ee25bf49aaf5ffba35f8cf6, type: 3} + m_Name: + m_EditorClassIdentifier: + syncMode: 0 + syncInterval: 0.1 + Players: [] + countOfRounds: 10 + spawnController: {fileID: 0} + localPlayer: {fileID: 0} diff --git a/Assets/Prefabs/DefrainNetworking/MatchController.prefab.meta b/Assets/Prefabs/DefrainNetworking/MatchController.prefab.meta new file mode 100644 index 0000000..1347118 --- /dev/null +++ b/Assets/Prefabs/DefrainNetworking/MatchController.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f0c1bca3291086d449266d9ed8942180 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/DefrainNetworking/NetworkManager.prefab b/Assets/Prefabs/DefrainNetworking/NetworkManager.prefab new file mode 100644 index 0000000..cd25c5d --- /dev/null +++ b/Assets/Prefabs/DefrainNetworking/NetworkManager.prefab @@ -0,0 +1,102 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4561035003361653274 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3365311783543717598} + - component: {fileID: 5784756223373504909} + - component: {fileID: 1160028143604224560} + - component: {fileID: 1251245409} + m_Layer: 0 + m_Name: NetworkManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3365311783543717598 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4561035003361653274} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 3.4827125, y: 2.271285, z: 6.642964} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5784756223373504909 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4561035003361653274} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8aab4c8111b7c411b9b92cf3dbc5bd4e, type: 3} + m_Name: + m_EditorClassIdentifier: + dontDestroyOnLoad: 1 + PersistNetworkManagerToOfflineScene: 0 + runInBackground: 1 + autoStartServerBuild: 1 + serverTickRate: 30 + offlineScene: Assets/Scenes/TestScene.unity + onlineScene: Assets/Scenes/TestScene.unity + transport: {fileID: 1160028143604224560} + networkAddress: localhost + maxConnections: 100 + authenticator: {fileID: 0} + playerPrefab: {fileID: 6272346181302961293, guid: a14d876ac00bdf6498e30b3e58b68fdf, type: 3} + autoCreatePlayer: 1 + playerSpawnMethod: 0 + spawnPrefabs: [] +--- !u!114 &1160028143604224560 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4561035003361653274} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6b0fecffa3f624585964b0d0eb21b18e, type: 3} + m_Name: + m_EditorClassIdentifier: + Port: 7777 + DualMode: 1 + NoDelay: 1 + Interval: 10 + Timeout: 10000 + FastResend: 2 + CongestionWindow: 0 + SendWindowSize: 4096 + ReceiveWindowSize: 4096 + NonAlloc: 1 + debugLog: 0 + statisticsGUI: 0 + statisticsLog: 0 +--- !u!114 &1251245409 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4561035003361653274} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6442dc8070ceb41f094e44de0bf87274, type: 3} + m_Name: + m_EditorClassIdentifier: + offsetX: 0 + offsetY: 0 diff --git a/Assets/Prefabs/DefrainNetworking/NetworkManager.prefab.meta b/Assets/Prefabs/DefrainNetworking/NetworkManager.prefab.meta new file mode 100644 index 0000000..6df239b --- /dev/null +++ b/Assets/Prefabs/DefrainNetworking/NetworkManager.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5cd2e2b44dc49ae44b48fc76a1e09712 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Networing/GameManager.prefab b/Assets/Prefabs/Networing/GameManager.prefab index de8d833..b4eab0a 100644 --- a/Assets/Prefabs/Networing/GameManager.prefab +++ b/Assets/Prefabs/Networing/GameManager.prefab @@ -14,6 +14,8 @@ GameObject: - component: {fileID: 3422988367618467038} - component: {fileID: -5945522205665126515} - component: {fileID: 3094132477016057847} + - component: {fileID: 840472934} + - component: {fileID: 840472941} m_Layer: 0 m_Name: GameManager m_TagString: GameController @@ -50,6 +52,7 @@ MonoBehaviour: m_EditorClassIdentifier: Players: [] countOfRounds: 10 + spawnController: {fileID: 0} localPlayer: {fileID: 0} --- !u!114 &3422988367618467037 MonoBehaviour: @@ -129,3 +132,32 @@ MonoBehaviour: autoCreatePlayer: 1 playerSpawnMethod: 0 spawnPrefabs: [] +--- !u!114 &840472934 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3422988367618467032} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4449624fc82d6174f85b2f83bbfa91f8, type: 3} + m_Name: + m_EditorClassIdentifier: + availableSpawns: + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} + - {fileID: 0} +--- !u!114 &840472941 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3422988367618467032} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: cc117181a5e845145888b1c152bcb4ad, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Assets/Prefabs/Player/Player Animation Test.prefab b/Assets/Prefabs/Player/Player Animation Test.prefab index 3f1af23..7f78553 100644 --- a/Assets/Prefabs/Player/Player Animation Test.prefab +++ b/Assets/Prefabs/Player/Player Animation Test.prefab @@ -1294,67 +1294,67 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: -6617984589164989631, guid: 01316cb596562384da845bc519fb90de, type: 3} propertyPath: m_LocalRotation.w - value: 0.49565774 + value: 0.42054832 objectReference: {fileID: 0} - target: {fileID: -6617984589164989631, guid: 01316cb596562384da845bc519fb90de, type: 3} propertyPath: m_LocalRotation.x - value: 0.4028321 + value: 0.57316214 objectReference: {fileID: 0} - target: {fileID: -6617984589164989631, guid: 01316cb596562384da845bc519fb90de, type: 3} propertyPath: m_LocalRotation.y - value: 0.47084302 + value: 0.45451018 objectReference: {fileID: 0} - target: {fileID: -6617984589164989631, guid: 01316cb596562384da845bc519fb90de, type: 3} propertyPath: m_LocalRotation.z - value: 0.6085693 + value: 0.5366981 objectReference: {fileID: 0} - target: {fileID: -5945183352512053224, guid: 01316cb596562384da845bc519fb90de, type: 3} propertyPath: m_LocalRotation.w - value: 0.5662176 + value: 0.42677584 objectReference: {fileID: 0} - target: {fileID: -5945183352512053224, guid: 01316cb596562384da845bc519fb90de, type: 3} propertyPath: m_LocalRotation.x - value: 0.8008484 + value: 0.87951803 objectReference: {fileID: 0} - target: {fileID: -5945183352512053224, guid: 01316cb596562384da845bc519fb90de, type: 3} propertyPath: m_LocalRotation.y - value: 0.04959982 + value: 0.037384924 objectReference: {fileID: 0} - target: {fileID: -5945183352512053224, guid: 01316cb596562384da845bc519fb90de, type: 3} propertyPath: m_LocalRotation.z - value: -0.18862498 + value: -0.20715398 objectReference: {fileID: 0} - target: {fileID: -5815427104119794202, guid: 01316cb596562384da845bc519fb90de, type: 3} propertyPath: m_LocalRotation.w - value: 0.6432096 + value: 0.35630274 objectReference: {fileID: 0} - target: {fileID: -5815427104119794202, guid: 01316cb596562384da845bc519fb90de, type: 3} propertyPath: m_LocalRotation.x - value: -0.7010284 + value: -0.83348465 objectReference: {fileID: 0} - target: {fileID: -5815427104119794202, guid: 01316cb596562384da845bc519fb90de, type: 3} propertyPath: m_LocalRotation.y - value: 0.02918151 + value: 0.10413144 objectReference: {fileID: 0} - target: {fileID: -5815427104119794202, guid: 01316cb596562384da845bc519fb90de, type: 3} propertyPath: m_LocalRotation.z - value: 0.30657643 + value: 0.40927806 objectReference: {fileID: 0} - target: {fileID: -4598867093515939143, guid: 01316cb596562384da845bc519fb90de, type: 3} propertyPath: m_LocalRotation.w - value: 0.64756745 + value: 0.35774222 objectReference: {fileID: 0} - target: {fileID: -4598867093515939143, guid: 01316cb596562384da845bc519fb90de, type: 3} propertyPath: m_LocalRotation.x - value: -0.6947033 + value: -0.82612306 objectReference: {fileID: 0} - target: {fileID: -4598867093515939143, guid: 01316cb596562384da845bc519fb90de, type: 3} propertyPath: m_LocalRotation.y - value: -0.034390952 + value: -0.114312366 objectReference: {fileID: 0} - target: {fileID: -4598867093515939143, guid: 01316cb596562384da845bc519fb90de, type: 3} propertyPath: m_LocalRotation.z - value: -0.3112249 + value: -0.42008814 objectReference: {fileID: 0} - target: {fileID: 919132149155446097, guid: 01316cb596562384da845bc519fb90de, type: 3} propertyPath: m_Name @@ -1362,35 +1362,35 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 1740614089614901821, guid: 01316cb596562384da845bc519fb90de, type: 3} propertyPath: m_LocalRotation.w - value: 0.556481 + value: 0.4137712 objectReference: {fileID: 0} - target: {fileID: 1740614089614901821, guid: 01316cb596562384da845bc519fb90de, type: 3} propertyPath: m_LocalRotation.x - value: 0.80733955 + value: 0.88543284 objectReference: {fileID: 0} - target: {fileID: 1740614089614901821, guid: 01316cb596562384da845bc519fb90de, type: 3} propertyPath: m_LocalRotation.y - value: -0.048747048 + value: -0.036245864 objectReference: {fileID: 0} - target: {fileID: 1740614089614901821, guid: 01316cb596562384da845bc519fb90de, type: 3} propertyPath: m_LocalRotation.z - value: 0.19014606 + value: 0.20853862 objectReference: {fileID: 0} - target: {fileID: 2965664082145358743, guid: 01316cb596562384da845bc519fb90de, type: 3} propertyPath: m_LocalRotation.w - value: 0.4882959 + value: 0.41165015 objectReference: {fileID: 0} - target: {fileID: 2965664082145358743, guid: 01316cb596562384da845bc519fb90de, type: 3} propertyPath: m_LocalRotation.x - value: 0.41018188 + value: 0.5740402 objectReference: {fileID: 0} - target: {fileID: 2965664082145358743, guid: 01316cb596562384da845bc519fb90de, type: 3} propertyPath: m_LocalRotation.y - value: -0.4844513 + value: -0.47313002 objectReference: {fileID: 0} - target: {fileID: 2965664082145358743, guid: 01316cb596562384da845bc519fb90de, type: 3} propertyPath: m_LocalRotation.z - value: -0.59885305 + value: -0.52646935 objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 01316cb596562384da845bc519fb90de, type: 3} diff --git a/Assets/Scenes/TestScene.unity b/Assets/Scenes/TestScene.unity index ffb4a8c..fd55a23 100644 --- a/Assets/Scenes/TestScene.unity +++ b/Assets/Scenes/TestScene.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 705507994} - m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} + m_IndirectSpecularColor: {r: 0.44657826, g: 0.49641263, b: 0.57481676, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -353,6 +353,102 @@ RectTransform: m_AnchoredPosition: {x: 5.3916016, y: -17.471985} m_SizeDelta: {x: 88.783295, y: 28.615997} m_Pivot: {x: 1, y: 1} +--- !u!1 &76630394 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 76630395} + - component: {fileID: 76630396} + m_Layer: 0 + m_Name: Spawnpoint 2 Team 2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &76630395 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 76630394} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -9.93, y: 5.64, z: 10.41} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1876458703} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &76630396 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 76630394} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2829074013a88f244be47100568015d5, type: 3} + m_Name: + m_EditorClassIdentifier: + teamID: 0 + available: 1 + blocked: 0 + position: {x: 0, y: 0, z: 0} +--- !u!1 &104338202 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 104338203} + - component: {fileID: 104338204} + m_Layer: 0 + m_Name: Spawnpoint 3 Team 2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &104338203 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 104338202} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 4.12, y: 5.64, z: 11.09} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1876458703} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &104338204 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 104338202} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2829074013a88f244be47100568015d5, type: 3} + m_Name: + m_EditorClassIdentifier: + teamID: 0 + available: 1 + blocked: 0 + position: {x: 0, y: 0, z: 0} --- !u!1 &203427802 GameObject: m_ObjectHideFlags: 0 @@ -553,71 +649,6 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: bd217f9f85ce78e46a925776562625e8, type: 3} ---- !u!1001 &419161482 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 3094132477016057847, guid: b62548b3f87093b4dbc561f3dd1abcb8, type: 3} - propertyPath: offlineScene - value: Assets/Scenes/TestScene.unity - objectReference: {fileID: 0} - - target: {fileID: 3094132477016057847, guid: b62548b3f87093b4dbc561f3dd1abcb8, type: 3} - propertyPath: playerPrefab - value: - objectReference: {fileID: 6272346181302961293, guid: a14d876ac00bdf6498e30b3e58b68fdf, type: 3} - - target: {fileID: 3422988367618467032, guid: b62548b3f87093b4dbc561f3dd1abcb8, type: 3} - propertyPath: m_Name - value: GameManager - objectReference: {fileID: 0} - - target: {fileID: 3422988367618467043, guid: b62548b3f87093b4dbc561f3dd1abcb8, type: 3} - propertyPath: m_RootOrder - value: 6 - objectReference: {fileID: 0} - - target: {fileID: 3422988367618467043, guid: b62548b3f87093b4dbc561f3dd1abcb8, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3422988367618467043, guid: b62548b3f87093b4dbc561f3dd1abcb8, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3422988367618467043, guid: b62548b3f87093b4dbc561f3dd1abcb8, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3422988367618467043, guid: b62548b3f87093b4dbc561f3dd1abcb8, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 3422988367618467043, guid: b62548b3f87093b4dbc561f3dd1abcb8, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3422988367618467043, guid: b62548b3f87093b4dbc561f3dd1abcb8, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3422988367618467043, guid: b62548b3f87093b4dbc561f3dd1abcb8, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3422988367618467043, guid: b62548b3f87093b4dbc561f3dd1abcb8, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3422988367618467043, guid: b62548b3f87093b4dbc561f3dd1abcb8, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 3422988367618467043, guid: b62548b3f87093b4dbc561f3dd1abcb8, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: b62548b3f87093b4dbc561f3dd1abcb8, type: 3} --- !u!1 &450235891 stripped GameObject: m_CorrespondingSourceObject: {fileID: -466329591000292508, guid: 823e8b39d52b71b4eb5a91dbc8d6d59e, type: 3} @@ -810,6 +841,54 @@ MeshCollider: m_Convex: 0 m_CookingOptions: 30 m_Mesh: {fileID: 8385836491182413749, guid: 823e8b39d52b71b4eb5a91dbc8d6d59e, type: 3} +--- !u!1 &655071529 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 655071530} + - component: {fileID: 655071531} + m_Layer: 0 + m_Name: Spawnpoint 1 Team 1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &655071530 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 655071529} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0.35, y: 5.64, z: -1.12} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1876458703} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &655071531 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 655071529} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2829074013a88f244be47100568015d5, type: 3} + m_Name: + m_EditorClassIdentifier: + teamID: 1 + available: 1 + blocked: 0 + position: {x: 0, y: 0, z: 0} --- !u!1 &670392703 stripped GameObject: m_CorrespondingSourceObject: {fileID: -3989346385401443251, guid: 823e8b39d52b71b4eb5a91dbc8d6d59e, type: 3} @@ -1080,6 +1159,54 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 823e8b39d52b71b4eb5a91dbc8d6d59e, type: 3} +--- !u!1 &753584348 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 753584349} + - component: {fileID: 753584350} + m_Layer: 0 + m_Name: Spawnpoint 1 Team 2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &753584349 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 753584348} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -10.37, y: 5.64, z: -1.75} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1876458703} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &753584350 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 753584348} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2829074013a88f244be47100568015d5, type: 3} + m_Name: + m_EditorClassIdentifier: + teamID: 0 + available: 1 + blocked: 0 + position: {x: 0, y: 0, z: 0} --- !u!1 &987854204 GameObject: m_ObjectHideFlags: 0 @@ -1318,7 +1445,7 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 7 + m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1351784389 GameObject: @@ -2047,6 +2174,41 @@ MeshCollider: m_Convex: 0 m_CookingOptions: 30 m_Mesh: {fileID: 8552134717624371188, guid: 823e8b39d52b71b4eb5a91dbc8d6d59e, type: 3} +--- !u!1 &1876458702 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1876458703} + m_Layer: 0 + m_Name: Spawnpoints + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1876458703 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1876458702} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 5.94973, y: 3.086451, z: -1.6778176} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 655071530} + - {fileID: 753584349} + - {fileID: 76630395} + - {fileID: 104338203} + m_Father: {fileID: 0} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &2119583729 GameObject: m_ObjectHideFlags: 0 @@ -2142,8 +2304,142 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 8 + m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &1496806602367600913 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 3365311783543717598, guid: 5cd2e2b44dc49ae44b48fc76a1e09712, type: 3} + propertyPath: m_RootOrder + value: 9 + objectReference: {fileID: 0} + - target: {fileID: 3365311783543717598, guid: 5cd2e2b44dc49ae44b48fc76a1e09712, type: 3} + propertyPath: m_LocalPosition.x + value: 3.4827125 + objectReference: {fileID: 0} + - target: {fileID: 3365311783543717598, guid: 5cd2e2b44dc49ae44b48fc76a1e09712, type: 3} + propertyPath: m_LocalPosition.y + value: 2.271285 + objectReference: {fileID: 0} + - target: {fileID: 3365311783543717598, guid: 5cd2e2b44dc49ae44b48fc76a1e09712, type: 3} + propertyPath: m_LocalPosition.z + value: 6.642964 + objectReference: {fileID: 0} + - target: {fileID: 3365311783543717598, guid: 5cd2e2b44dc49ae44b48fc76a1e09712, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3365311783543717598, guid: 5cd2e2b44dc49ae44b48fc76a1e09712, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3365311783543717598, guid: 5cd2e2b44dc49ae44b48fc76a1e09712, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3365311783543717598, guid: 5cd2e2b44dc49ae44b48fc76a1e09712, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3365311783543717598, guid: 5cd2e2b44dc49ae44b48fc76a1e09712, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3365311783543717598, guid: 5cd2e2b44dc49ae44b48fc76a1e09712, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3365311783543717598, guid: 5cd2e2b44dc49ae44b48fc76a1e09712, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4561035003361653274, guid: 5cd2e2b44dc49ae44b48fc76a1e09712, type: 3} + propertyPath: m_Name + value: NetworkManager + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 5cd2e2b44dc49ae44b48fc76a1e09712, type: 3} +--- !u!1001 &3454029965885532949 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 230145200, guid: f0c1bca3291086d449266d9ed8942180, type: 3} + propertyPath: availableSpawns.Array.data[0] + value: + objectReference: {fileID: 655071531} + - target: {fileID: 230145200, guid: f0c1bca3291086d449266d9ed8942180, type: 3} + propertyPath: availableSpawns.Array.data[1] + value: + objectReference: {fileID: 753584350} + - target: {fileID: 230145200, guid: f0c1bca3291086d449266d9ed8942180, type: 3} + propertyPath: availableSpawns.Array.data[2] + value: + objectReference: {fileID: 76630396} + - target: {fileID: 230145200, guid: f0c1bca3291086d449266d9ed8942180, type: 3} + propertyPath: availableSpawns.Array.data[3] + value: + objectReference: {fileID: 104338204} + - target: {fileID: 2655719566820584133, guid: f0c1bca3291086d449266d9ed8942180, type: 3} + propertyPath: sceneId + value: 4169713921 + objectReference: {fileID: 0} + - target: {fileID: 2849906635484503724, guid: f0c1bca3291086d449266d9ed8942180, type: 3} + propertyPath: m_RootOrder + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 2849906635484503724, guid: f0c1bca3291086d449266d9ed8942180, type: 3} + propertyPath: m_LocalPosition.x + value: 3.4827125 + objectReference: {fileID: 0} + - target: {fileID: 2849906635484503724, guid: f0c1bca3291086d449266d9ed8942180, type: 3} + propertyPath: m_LocalPosition.y + value: 2.271285 + objectReference: {fileID: 0} + - target: {fileID: 2849906635484503724, guid: f0c1bca3291086d449266d9ed8942180, type: 3} + propertyPath: m_LocalPosition.z + value: 6.642964 + objectReference: {fileID: 0} + - target: {fileID: 2849906635484503724, guid: f0c1bca3291086d449266d9ed8942180, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2849906635484503724, guid: f0c1bca3291086d449266d9ed8942180, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2849906635484503724, guid: f0c1bca3291086d449266d9ed8942180, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2849906635484503724, guid: f0c1bca3291086d449266d9ed8942180, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2849906635484503724, guid: f0c1bca3291086d449266d9ed8942180, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2849906635484503724, guid: f0c1bca3291086d449266d9ed8942180, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2849906635484503724, guid: f0c1bca3291086d449266d9ed8942180, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3974865484676985655, guid: f0c1bca3291086d449266d9ed8942180, type: 3} + propertyPath: m_Name + value: MatchController + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: f0c1bca3291086d449266d9ed8942180, type: 3} --- !u!1001 &8307265127065581321 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/DefrainNetworking.meta b/Assets/Scripts/DefrainNetworking.meta new file mode 100644 index 0000000..705f4dc --- /dev/null +++ b/Assets/Scripts/DefrainNetworking.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6f6420073b2c41a48bb7845b9b3af0f1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/DefrainNetworking/DefrainSpawnController.cs b/Assets/Scripts/DefrainNetworking/DefrainSpawnController.cs new file mode 100644 index 0000000..a9d7724 --- /dev/null +++ b/Assets/Scripts/DefrainNetworking/DefrainSpawnController.cs @@ -0,0 +1,61 @@ +using System.Collections.Generic; +using UnityEngine; +using Mirror; + +/* + Documentation: https://mirror-networking.gitbook.io/docs/guides/networkbehaviour + API Reference: https://mirror-networking.com/docs/api/Mirror.NetworkBehaviour.html +*/ + +// NOTE: Do not put objects in DontDestroyOnLoad (DDOL) in Awake. You can do that in Start instead. + +public class DefrainSpawnController : NetworkBehaviour +{ + #region Start & Stop Callbacks + + /// + /// This is invoked for NetworkBehaviour objects when they become active on the server. + /// This could be triggered by NetworkServer.Listen() for objects in the scene, or by NetworkServer.Spawn() for objects that are dynamically created. + /// This will be called for objects on a "host" as well as for object on a dedicated server. + /// + public override void OnStartServer() { } + + /// + /// Invoked on the server when the object is unspawned + /// Useful for saving object data in persistent storage + /// + public override void OnStopServer() { } + + /// + /// Called on every NetworkBehaviour when it is activated on a client. + /// Objects on the host have this function called, as there is a local client on the host. The values of SyncVars on object are guaranteed to be initialized correctly with the latest state from the server when this function is called on the client. + /// + public override void OnStartClient() { } + + /// + /// This is invoked on clients when the server has caused this object to be destroyed. + /// This can be used as a hook to invoke effects or do client specific cleanup. + /// + public override void OnStopClient() { } + + /// + /// Called when the local player object has been set up. + /// This happens after OnStartClient(), as it is triggered by an ownership message from the server. This is an appropriate place to activate components or functionality that should only be active for the local player, such as cameras and input. + /// + public override void OnStartLocalPlayer() { } + + /// + /// This is invoked on behaviours that have authority, based on context and NetworkIdentity.hasAuthority. + /// This is called after OnStartServer and before OnStartClient. + /// When AssignClientAuthority is called on the server, this will be called on the client that owns the object. When an object is spawned with NetworkServer.Spawn with a NetworkConnection parameter included, this will be called on the client that owns the object. + /// + public override void OnStartAuthority() { } + + /// + /// This is invoked on behaviours when authority is removed. + /// When NetworkIdentity.RemoveClientAuthority is called on the server, this will be called on the client that owns the object. + /// + public override void OnStopAuthority() { } + + #endregion +} diff --git a/Assets/Scripts/DefrainNetworking/DefrainSpawnController.cs.meta b/Assets/Scripts/DefrainNetworking/DefrainSpawnController.cs.meta new file mode 100644 index 0000000..8ed0375 --- /dev/null +++ b/Assets/Scripts/DefrainNetworking/DefrainSpawnController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a57722a4a9f575b46b99d60d2d9eb2bf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/GameManager/DefrainNetworkManager.cs b/Assets/Scripts/GameManager/DefrainNetworkManager.cs new file mode 100644 index 0000000..7dfa97d --- /dev/null +++ b/Assets/Scripts/GameManager/DefrainNetworkManager.cs @@ -0,0 +1,248 @@ +using System; +using UnityEngine; +using UnityEngine.SceneManagement; +using Mirror; + +/* + Documentation: https://mirror-networking.gitbook.io/docs/components/network-manager + API Reference: https://mirror-networking.com/docs/api/Mirror.NetworkManager.html +*/ + +public class DefrainNetworkManager : NetworkManager +{ + #region Unity Callbacks + + public override void OnValidate() + { + base.OnValidate(); + } + + /// + /// Runs on both Server and Client + /// Networking is NOT initialized when this fires + /// + public override void Awake() + { + base.Awake(); + } + + /// + /// Runs on both Server and Client + /// Networking is NOT initialized when this fires + /// + public override void Start() + { + base.Start(); + } + + /// + /// Runs on both Server and Client + /// + public override void LateUpdate() + { + base.LateUpdate(); + } + + /// + /// Runs on both Server and Client + /// + public override void OnDestroy() + { + base.OnDestroy(); + } + + #endregion + + #region Start & Stop + + /// + /// Set the frame rate for a headless server. + /// Override if you wish to disable the behavior or set your own tick rate. + /// + public override void ConfigureHeadlessFrameRate() + { + base.ConfigureHeadlessFrameRate(); + } + + /// + /// called when quitting the application by closing the window / pressing stop in the editor + /// + public override void OnApplicationQuit() + { + base.OnApplicationQuit(); + } + + #endregion + + #region Scene Management + + /// + /// This causes the server to switch scenes and sets the networkSceneName. + /// Clients that connect to this server will automatically switch to this scene. This is called automatically if onlineScene or offlineScene are set, but it can be called from user code to switch scenes again while the game is in progress. This automatically sets clients to be not-ready. The clients must call NetworkClient.Ready() again to participate in the new scene. + /// + /// + public override void ServerChangeScene(string newSceneName) + { + base.ServerChangeScene(newSceneName); + } + + /// + /// Called from ServerChangeScene immediately before SceneManager.LoadSceneAsync is executed + /// This allows server to do work / cleanup / prep before the scene changes. + /// + /// Name of the scene that's about to be loaded + public override void OnServerChangeScene(string newSceneName) { } + + /// + /// Called on the server when a scene is completed loaded, when the scene load was initiated by the server with ServerChangeScene(). + /// + /// The name of the new scene. + public override void OnServerSceneChanged(string sceneName) { } + + /// + /// Called from ClientChangeScene immediately before SceneManager.LoadSceneAsync is executed + /// This allows client to do work / cleanup / prep before the scene changes. + /// + /// Name of the scene that's about to be loaded + /// Scene operation that's about to happen + /// true to indicate that scene loading will be handled through overrides + public override void OnClientChangeScene(string newSceneName, SceneOperation sceneOperation, bool customHandling) { } + + /// + /// Called on clients when a scene has completed loaded, when the scene load was initiated by the server. + /// Scene changes can cause player objects to be destroyed. The default implementation of OnClientSceneChanged in the NetworkManager is to add a player object for the connection if no player object exists. + /// + /// The network connection that the scene change message arrived on. + public override void OnClientSceneChanged(NetworkConnection conn) + { + base.OnClientSceneChanged(conn); + } + + #endregion + + #region Server System Callbacks + + /// + /// Called on the server when a new client connects. + /// Unity calls this on the Server when a Client connects to the Server. Use an override to tell the NetworkManager what to do when a client connects to the server. + /// + /// Connection from client. + public override void OnServerConnect(NetworkConnection conn) { } + + /// + /// Called on the server when a client is ready. + /// The default implementation of this function calls NetworkServer.SetClientReady() to continue the network setup process. + /// + /// Connection from client. + public override void OnServerReady(NetworkConnection conn) + { + base.OnServerReady(conn); + } + + /// + /// Called on the server when a client adds a new player with ClientScene.AddPlayer. + /// The default implementation for this function creates a new player object from the playerPrefab. + /// + /// Connection from client. + public override void OnServerAddPlayer(NetworkConnection conn) + { + base.OnServerAddPlayer(conn); + } + + /// + /// Called on the server when a client disconnects. + /// This is called on the Server when a Client disconnects from the Server. Use an override to decide what should happen when a disconnection is detected. + /// + /// Connection from client. + public override void OnServerDisconnect(NetworkConnection conn) + { + base.OnServerDisconnect(conn); + } + + /// + /// Called on server when transport raises an exception. + /// NetworkConnection may be null. + /// + /// Connection of the client...may be null + /// Exception thrown from the Transport. + public override void OnServerError(NetworkConnection conn, Exception exception) { } + + #endregion + + #region Client System Callbacks + + /// + /// Called on the client when connected to a server. + /// The default implementation of this function sets the client as ready and adds a player. Override the function to dictate what happens when the client connects. + /// + /// Connection to the server. + public override void OnClientConnect(NetworkConnection conn) + { + base.OnClientConnect(conn); + } + + /// + /// Called on clients when disconnected from a server. + /// This is called on the client when it disconnects from the server. Override this function to decide what happens when the client disconnects. + /// + /// Connection to the server. + public override void OnClientDisconnect(NetworkConnection conn) + { + base.OnClientDisconnect(conn); + } + + /// + /// Called on clients when a servers tells the client it is no longer ready. + /// This is commonly used when switching scenes. + /// + /// Connection to the server. + public override void OnClientNotReady(NetworkConnection conn) { } + + /// + /// Called on client when transport raises an exception. + /// + /// Exception thrown from the Transport. + public override void OnClientError(Exception exception) { } + + #endregion + + #region Start & Stop Callbacks + + // Since there are multiple versions of StartServer, StartClient and StartHost, to reliably customize + // their functionality, users would need override all the versions. Instead these callbacks are invoked + // from all versions, so users only need to implement this one case. + + /// + /// This is invoked when a host is started. + /// StartHost has multiple signatures, but they all cause this hook to be called. + /// + public override void OnStartHost() { } + + /// + /// This is invoked when a server is started - including when a host is started. + /// StartServer has multiple signatures, but they all cause this hook to be called. + /// + public override void OnStartServer() { } + + /// + /// This is invoked when the client is started. + /// + public override void OnStartClient() { } + + /// + /// This is called when a host is stopped. + /// + public override void OnStopHost() { } + + /// + /// This is called when a server is stopped - including when a host is stopped. + /// + public override void OnStopServer() { } + + /// + /// This is called when a client is stopped. + /// + public override void OnStopClient() { } + + #endregion +} diff --git a/Assets/Scripts/GameManager/DefrainNetworkManager.cs.meta b/Assets/Scripts/GameManager/DefrainNetworkManager.cs.meta new file mode 100644 index 0000000..db17551 --- /dev/null +++ b/Assets/Scripts/GameManager/DefrainNetworkManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 98670bc969268d14aa751075cb687ee5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/GameManager/GameMaster.cs b/Assets/Scripts/GameManager/GameMaster.cs index 2083bc2..2f1eaaf 100644 --- a/Assets/Scripts/GameManager/GameMaster.cs +++ b/Assets/Scripts/GameManager/GameMaster.cs @@ -1,7 +1,7 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; - +using Mirror; // Erstellung von Teams @@ -9,16 +9,33 @@ using UnityEngine; // Verwaltung der Spieler und Teams // -public class GameMaster : MonoBehaviour +public class GameMaster : NetworkBehaviour { + int gameState = 0; + [Header("GameMaster")] [SerializeField] private List Players = new List(); [SerializeField] private int countOfRounds = 10; + public SpawnController spawnController; + private TeamManager teamManager; + public GameObject localPlayer; + public void RegisterPlayer(Player player) + { + Players.Add(player); + teamManager.AddTeam().AddPlayer(player); + } + private void Start() + { + spawnController = GetComponent(); + teamManager = GetComponent(); + } private void Update() { + StateMachine(); + if (Input.GetKeyDown(KeyCode.H)) { @@ -35,4 +52,54 @@ public class GameMaster : MonoBehaviour + + void StateMachine() + { + switch (gameState) + { + case 0: + //Select teams + if (Input.GetButtonDown("Sprint")) + { + gameState++; + } + + break; + case 1: + foreach (Player player in Players) + { + if (spawnController.GetAvailableSpawnPoint(player.team.teamID, out Vector3 v)) + { + player.respawnPos(v); + } + } + gameState++; + break; + case 2: + foreach (Team team in teamManager.Teams) + { + if (!teamManager.teamAlive(team.teamID)) + { + team.score++; + gameState++; + } + } + break; + case 3: + gameState = 0; + Debug.Log("Team died"); + break; + default: + break; + } + } + + public Vector3 RespawnRequest(GameObject player,int teamID) + { + if (spawnController.GetAvailableSpawnPoint(teamID, out Vector3 spawnpoint)) + { + return spawnpoint; + } + return player.transform.position; + } } diff --git a/Assets/Scripts/GameManager/SpawnController.cs b/Assets/Scripts/GameManager/SpawnController.cs new file mode 100644 index 0000000..54a8d25 --- /dev/null +++ b/Assets/Scripts/GameManager/SpawnController.cs @@ -0,0 +1,39 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class SpawnController : MonoBehaviour +{ + //Spawnpoints + [Header("Spawnpoints")] + [SerializeField] List availableSpawns = new List(); + + void Start() + { + } + + + // Update is called once per frame + void Update() + { + + } + + + public bool GetAvailableSpawnPoint(int teamID,out Vector3 spawnPosition) + { + + foreach (Spawnpoint spawn in availableSpawns) + { + if (spawn.teamID == teamID && spawn.available && !spawn.blocked) + { + spawnPosition = spawn.position; + spawn.disableForSeconds(15f); + + return true; + } + } + spawnPosition = new Vector3(); + return false; + } +} diff --git a/Assets/Scripts/GameManager/SpawnController.cs.meta b/Assets/Scripts/GameManager/SpawnController.cs.meta new file mode 100644 index 0000000..915518d --- /dev/null +++ b/Assets/Scripts/GameManager/SpawnController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4449624fc82d6174f85b2f83bbfa91f8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/GameManager/Spawnpoint.cs b/Assets/Scripts/GameManager/Spawnpoint.cs new file mode 100644 index 0000000..92f1707 --- /dev/null +++ b/Assets/Scripts/GameManager/Spawnpoint.cs @@ -0,0 +1,34 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class Spawnpoint : MonoBehaviour +{ + [SerializeField] public int teamID = 0; + [SerializeField] public bool available = true; + [SerializeField] public bool blocked = false; + public Vector3 position; + private void Awake() + { + position = this.transform.position; + } + void Start() + { + + } + IEnumerator disableEnum(float time) + { + available = false; + yield return new WaitForSeconds(time); + available = true; + } + public void disableForSeconds(float time) + { + StartCoroutine(disableEnum(time)); + } + // Update is called once per frame + void Update() + { + + } +} diff --git a/Assets/Scripts/GameManager/Spawnpoint.cs.meta b/Assets/Scripts/GameManager/Spawnpoint.cs.meta new file mode 100644 index 0000000..0230a27 --- /dev/null +++ b/Assets/Scripts/GameManager/Spawnpoint.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2829074013a88f244be47100568015d5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/GameManager/Team.cs b/Assets/Scripts/GameManager/Team.cs index 4e661fd..ad58345 100644 --- a/Assets/Scripts/GameManager/Team.cs +++ b/Assets/Scripts/GameManager/Team.cs @@ -5,17 +5,38 @@ using UnityEngine; public class Team { private string name; - private int score; + public int score; + public int teamID; + public int teamSize; + public List players = new List(); - public Team(string _name, int _score) + public Team(string _name, int TeamID,int TeamSize) { name = _name; - score = _score; + teamID = TeamID; + teamSize = TeamSize; + score = 0; - Debug.Log(name + " Team Created!"); + Debug.Log(name + " Team Created! Their Team ID is " + teamID); + } + public bool AddPlayer(Player player) + { + if (players.Count < teamSize || teamSize == -1) + { + players.Add(player); + player.team = this; + return true; + } + return false; } - public string GetTeamName() + public void RemovePlayer(Player player) + { + players.Remove(player); + player.team = null; + } + + public string GetTeamName() { return name; } diff --git a/Assets/Scripts/GameManager/TeamManager.cs b/Assets/Scripts/GameManager/TeamManager.cs new file mode 100644 index 0000000..d510c14 --- /dev/null +++ b/Assets/Scripts/GameManager/TeamManager.cs @@ -0,0 +1,49 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class TeamManager : MonoBehaviour +{ + + public List Teams = new List(); + int teamIdCount = 0; + + public Team AddTeam(string name = "Team") + { + Team team = new Team(name, teamIdCount, -1); + Teams.Add(team); + teamIdCount++; + return team; + } + public bool teamAlive(int teamID) + { + bool tAlive = false; + foreach (Player player in Teams[teamID].players) + { + if (player.isAlive) tAlive = true; + } + if (Teams[teamID].players.Count == 0) tAlive = true; + return tAlive; + } + public Team AddPlayerToRandomTeam(Player player) + { + int trys = 0; + while(trys < 10) + { + int index = (int)Random.Range(0, Teams.Count - 1); + if (Teams[index].AddPlayer(player)) return Teams[index]; + trys++; + } + return null; + } + + public Team GetTeamByID(int TeamID) + { + for (int i = 0; i < Teams.Count; i ++) + { + if (Teams[i].teamID == TeamID) return Teams[i]; + } + return null; + } + +} diff --git a/Assets/Scripts/GameManager/TeamManager.cs.meta b/Assets/Scripts/GameManager/TeamManager.cs.meta new file mode 100644 index 0000000..59013ac --- /dev/null +++ b/Assets/Scripts/GameManager/TeamManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cc117181a5e845145888b1c152bcb4ad +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Player/Player.cs b/Assets/Scripts/Player/Player.cs index a6f4584..7eb7d99 100644 --- a/Assets/Scripts/Player/Player.cs +++ b/Assets/Scripts/Player/Player.cs @@ -8,6 +8,8 @@ public class Player : NetworkBehaviour public bool isAlive = true; public Team team; [SerializeField] private const int defaultHp = 100; + GameObject GameManager; + GameMaster gameMaster; public ulong clientId; @@ -23,9 +25,30 @@ public class Player : NetworkBehaviour private void Start() { + + GameManager = GameObject.Find("MatchController"); + gameMaster = GameManager.GetComponent(); if (isServer) { health = defaultHp; + gameMaster.RegisterPlayer(GetComponent()); + //respawnPos(gameMaster.RespawnRequest(this.gameObject, team.teamID)); + } + + + } + + private void Update() + { + if (isLocalPlayer) + { + if (Input.GetKeyDown("n")) + { + //Debug.Log("Request respawn on local player"); + CmdRespawnRequest(); + //transform.position = Vector3.zero; + + } } } public override void OnStartLocalPlayer() @@ -46,6 +69,23 @@ public class Player : NetworkBehaviour } public void Respawn() { + + + } + [Command] + void CmdRespawnRequest() + { + respawnPos(gameMaster.RespawnRequest(this.gameObject, team.teamID)); + isAlive = true; + } + + [ClientRpc] + public void respawnPos(Vector3 pos) + { + GetComponent().enabled = false; + transform.position = pos; + GetComponent().enabled = true; + health = defaultHp; isAlive = true; } @@ -53,6 +93,7 @@ public class Player : NetworkBehaviour { isAlive = false; AddDeaths(1); + Debug.Log("DIE"); } //Health @@ -70,11 +111,9 @@ public class Player : NetworkBehaviour if (isAlive) { - /*Debug.Log("yeet" + value);*/ health -= value; if (health <= 0) { - AddDeaths(1); health = 0; Die(); } @@ -139,3 +178,7 @@ public class Player : NetworkBehaviour } } + + + + diff --git a/Assets/Scripts/Player/PlayerController.cs b/Assets/Scripts/Player/PlayerController.cs index 2d0cad9..385d3e1 100644 --- a/Assets/Scripts/Player/PlayerController.cs +++ b/Assets/Scripts/Player/PlayerController.cs @@ -54,7 +54,6 @@ public class PlayerController : NetworkBehaviour Grounded(); CheckGoundAngle(); UpdateMovement(); - } } @@ -151,6 +150,7 @@ public class PlayerController : NetworkBehaviour velocity = Vector3.SmoothDamp(velocity, currentDir * movementSpeed + new Vector3(0, velocityY, 0),ref refVelocity,0.01f); controller.Move(velocity * Time.deltaTime); + //transform.position += velocity * Time.deltaTime; } } diff --git a/Assets/Scripts/Weapons/Shoot.cs b/Assets/Scripts/Weapons/Shoot.cs index 6c86b53..bb34cbe 100644 --- a/Assets/Scripts/Weapons/Shoot.cs +++ b/Assets/Scripts/Weapons/Shoot.cs @@ -46,7 +46,6 @@ public class Shoot : NetworkBehaviour } if (Input.GetButtonDown("Fire")) { updateCanvas = true; - Debug.Log(" click"); if (weapon.AllowAction) { shootAnim.Recoil(0.1f); @@ -86,7 +85,6 @@ public class Shoot : NetworkBehaviour if (Physics.Raycast(muzzle.transform.position, muzzle.transform.forward, out hit) && weapon.CurrentAmmunition > 0) { // Raycast from Bullet Exit Point to camera raycast bulletHole(GameObject.CreatePrimitive(PrimitiveType.Sphere), hit); // Creates bullethole where raycast hits if (hit.transform.gameObject.GetComponent() != null) { // If hit object is a player - Debug.Log("-->HIT PLAYER: " + hit.transform.name); hit.transform.gameObject.GetComponent().RemoveHealth(weapon.Damage); } } diff --git a/Assets/Scripts/Yeet.cs b/Assets/Scripts/Yeet.cs new file mode 100644 index 0000000..4ed7213 --- /dev/null +++ b/Assets/Scripts/Yeet.cs @@ -0,0 +1,61 @@ +using System.Collections.Generic; +using UnityEngine; +using Mirror; + +/* + Documentation: https://mirror-networking.gitbook.io/docs/guides/networkbehaviour + API Reference: https://mirror-networking.com/docs/api/Mirror.NetworkBehaviour.html +*/ + +// NOTE: Do not put objects in DontDestroyOnLoad (DDOL) in Awake. You can do that in Start instead. + +public class Yeet : NetworkBehaviour +{ + #region Start & Stop Callbacks + + /// + /// This is invoked for NetworkBehaviour objects when they become active on the server. + /// This could be triggered by NetworkServer.Listen() for objects in the scene, or by NetworkServer.Spawn() for objects that are dynamically created. + /// This will be called for objects on a "host" as well as for object on a dedicated server. + /// + public override void OnStartServer() { } + + /// + /// Invoked on the server when the object is unspawned + /// Useful for saving object data in persistent storage + /// + public override void OnStopServer() { } + + /// + /// Called on every NetworkBehaviour when it is activated on a client. + /// Objects on the host have this function called, as there is a local client on the host. The values of SyncVars on object are guaranteed to be initialized correctly with the latest state from the server when this function is called on the client. + /// + public override void OnStartClient() { } + + /// + /// This is invoked on clients when the server has caused this object to be destroyed. + /// This can be used as a hook to invoke effects or do client specific cleanup. + /// + public override void OnStopClient() { } + + /// + /// Called when the local player object has been set up. + /// This happens after OnStartClient(), as it is triggered by an ownership message from the server. This is an appropriate place to activate components or functionality that should only be active for the local player, such as cameras and input. + /// + public override void OnStartLocalPlayer() { } + + /// + /// This is invoked on behaviours that have authority, based on context and NetworkIdentity.hasAuthority. + /// This is called after OnStartServer and before OnStartClient. + /// When AssignClientAuthority is called on the server, this will be called on the client that owns the object. When an object is spawned with NetworkServer.Spawn with a NetworkConnection parameter included, this will be called on the client that owns the object. + /// + public override void OnStartAuthority() { } + + /// + /// This is invoked on behaviours when authority is removed. + /// When NetworkIdentity.RemoveClientAuthority is called on the server, this will be called on the client that owns the object. + /// + public override void OnStopAuthority() { } + + #endregion +} diff --git a/Assets/Scripts/Yeet.cs.meta b/Assets/Scripts/Yeet.cs.meta new file mode 100644 index 0000000..42fd360 --- /dev/null +++ b/Assets/Scripts/Yeet.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 24aee7fa40024d347b3ef3c5e0543078 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UserSettings/Layouts/default-2021.dwlt b/UserSettings/Layouts/default-2021.dwlt index 3c2bcaa..cf01531 100644 --- a/UserSettings/Layouts/default-2021.dwlt +++ b/UserSettings/Layouts/default-2021.dwlt @@ -19,7 +19,7 @@ MonoBehaviour: width: 1536 height: 780.8 m_ShowMode: 4 - m_Title: Project + m_Title: Game m_RootView: {fileID: 2} m_MinSize: {x: 875, y: 300} m_MaxSize: {x: 10000, y: 10000} @@ -45,7 +45,7 @@ MonoBehaviour: x: 0 y: 0 width: 1536 - height: 781 + height: 780.8 m_MinSize: {x: 875, y: 300} m_MaxSize: {x: 10000, y: 10000} m_UseTopView: 1 @@ -90,7 +90,7 @@ MonoBehaviour: m_Position: serializedVersion: 2 x: 0 - y: 761 + y: 760.8 width: 1536 height: 20 m_MinSize: {x: 0, y: 0} @@ -115,11 +115,11 @@ MonoBehaviour: x: 0 y: 30 width: 1536 - height: 731 + height: 730.8 m_MinSize: {x: 400, y: 200} m_MaxSize: {x: 32384, y: 16192} vertical: 0 - controlID: 111 + controlID: 58 --- !u!114 &6 MonoBehaviour: m_ObjectHideFlags: 52 @@ -139,12 +139,12 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 0 - width: 1269 - height: 731 + width: 1130.4 + height: 730.8 m_MinSize: {x: 300, y: 200} m_MaxSize: {x: 24288, y: 16192} vertical: 1 - controlID: 112 + controlID: 59 --- !u!114 &7 MonoBehaviour: m_ObjectHideFlags: 52 @@ -165,12 +165,12 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 0 - width: 1269 - height: 439 + width: 1130.4 + height: 438.4 m_MinSize: {x: 300, y: 100} m_MaxSize: {x: 24288, y: 8096} vertical: 0 - controlID: 113 + controlID: 60 --- !u!114 &8 MonoBehaviour: m_ObjectHideFlags: 52 @@ -188,10 +188,10 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 0 - width: 243 - height: 439 - m_MinSize: {x: 201, y: 221} - m_MaxSize: {x: 4001, y: 4021} + width: 329.6 + height: 438.4 + m_MinSize: {x: 200, y: 200} + m_MaxSize: {x: 4000, y: 4000} m_ActualView: {fileID: 14} m_Panes: - {fileID: 14} @@ -212,12 +212,12 @@ MonoBehaviour: m_Children: [] m_Position: serializedVersion: 2 - x: 243 + x: 329.6 y: 0 - width: 493 - height: 439 - m_MinSize: {x: 202, y: 221} - m_MaxSize: {x: 4002, y: 4021} + width: 320.80002 + height: 438.4 + m_MinSize: {x: 200, y: 200} + m_MaxSize: {x: 4000, y: 4000} m_ActualView: {fileID: 16} m_Panes: - {fileID: 15} @@ -239,10 +239,10 @@ MonoBehaviour: m_Children: [] m_Position: serializedVersion: 2 - x: 736 + x: 650.4 y: 0 - width: 533 - height: 439 + width: 480 + height: 438.4 m_MinSize: {x: 200, y: 200} m_MaxSize: {x: 4000, y: 4000} m_ActualView: {fileID: 13} @@ -260,23 +260,23 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 1 m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0} - m_Name: ProjectBrowser + m_Name: ConsoleWindow m_EditorClassIdentifier: m_Children: [] m_Position: serializedVersion: 2 x: 0 - y: 439 - width: 1269 - height: 292 - m_MinSize: {x: 231, y: 271} - m_MaxSize: {x: 10001, y: 10021} - m_ActualView: {fileID: 17} + y: 438.4 + width: 1130.4 + height: 292.4 + m_MinSize: {x: 100, y: 100} + m_MaxSize: {x: 4000, y: 4000} + m_ActualView: {fileID: 18} m_Panes: - {fileID: 17} - {fileID: 18} - m_Selected: 0 - m_LastSelected: 1 + m_Selected: 1 + m_LastSelected: 0 --- !u!114 &12 MonoBehaviour: m_ObjectHideFlags: 52 @@ -292,10 +292,10 @@ MonoBehaviour: m_Children: [] m_Position: serializedVersion: 2 - x: 1269 + x: 1130.4 y: 0 - width: 267 - height: 731 + width: 405.59998 + height: 730.8 m_MinSize: {x: 276, y: 71} m_MaxSize: {x: 4001, y: 4021} m_ActualView: {fileID: 19} @@ -323,10 +323,10 @@ MonoBehaviour: m_Tooltip: m_Pos: serializedVersion: 2 - x: 736 + x: 650.4 y: 73.6 - width: 531 - height: 418 + width: 478 + height: 417.4 m_ViewDataDictionary: {fileID: 0} m_OverlayCanvas: m_LastAppliedPresetName: Default @@ -337,7 +337,7 @@ MonoBehaviour: m_ShowGizmos: 0 m_TargetDisplay: 0 m_ClearColor: {r: 0, g: 0, b: 0, a: 0} - m_TargetSize: {x: 531, y: 397} + m_TargetSize: {x: 478, y: 396.4} m_TextureFilterMode: 0 m_TextureHideFlags: 61 m_RenderIMGUI: 1 @@ -352,10 +352,10 @@ MonoBehaviour: m_VRangeLocked: 0 hZoomLockedByDefault: 0 vZoomLockedByDefault: 0 - m_HBaseRangeMin: -212.40001 - m_HBaseRangeMax: 212.40001 - m_VBaseRangeMin: -158.8 - m_VBaseRangeMax: 158.8 + m_HBaseRangeMin: -191.2 + m_HBaseRangeMax: 191.2 + m_VBaseRangeMin: -158.56 + m_VBaseRangeMax: 158.56 m_HAllowExceedBaseRangeMin: 1 m_HAllowExceedBaseRangeMax: 1 m_VAllowExceedBaseRangeMin: 1 @@ -373,23 +373,23 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 21 - width: 531 - height: 397 + width: 478 + height: 396.4 m_Scale: {x: 1.2742728, y: 1.2742728} - m_Translation: {x: 260.34442, y: 200.231} + m_Translation: {x: 236.31642, y: 199.931} m_MarginLeft: 0 m_MarginRight: 0 m_MarginTop: 0 m_MarginBottom: 0 m_LastShownAreaInsideMargins: serializedVersion: 2 - x: -204.30823 - y: -157.13354 - width: 416.70825 - height: 311.55023 + x: -185.45198 + y: -156.89812 + width: 375.1159 + height: 311.07938 m_MinimalGUI: 1 m_defaultScale: 1 - m_LastWindowPixelSize: {x: 663.75, y: 522.5} + m_LastWindowPixelSize: {x: 597.5, y: 521.75} m_ClearInEditMode: 1 m_NoCameraWarning: 1 m_LowResolutionForAspectRatios: 01000000000000000000 @@ -417,8 +417,8 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 73.6 - width: 242 - height: 418 + width: 328.6 + height: 417.4 m_ViewDataDictionary: {fileID: 0} m_OverlayCanvas: m_LastAppliedPresetName: Default @@ -428,7 +428,7 @@ MonoBehaviour: scrollPos: {x: 0, y: 0} m_SelectedIDs: m_LastClickedID: 0 - m_ExpandedIDs: 2afbffff + m_ExpandedIDs: be6effff0c6fffff3473fffff27cffff407dffff6881ffff5488ffffa288ffffee8affff968bffffe48bffff0c90ffff389dffff869dffffaaa1ffff64b1ffffb2b1ffffd6b5ffffecddffff3adeffff5ce2ffff78e6ffff18ebffffceecffff1cedffff34f1fffffcf7ffff2afbffff12900000 m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -444,7 +444,7 @@ MonoBehaviour: m_IsRenaming: 0 m_OriginalEventType: 11 m_IsRenamingFilename: 0 - m_ClientGUIView: {fileID: 8} + m_ClientGUIView: {fileID: 9} m_SearchString: m_ExpandedScenes: [] m_CurrenRootInstanceID: 0 @@ -536,10 +536,10 @@ MonoBehaviour: m_Tooltip: m_Pos: serializedVersion: 2 - x: 243.2 + x: 329.6 y: 73.6 - width: 491 - height: 418 + width: 318.80002 + height: 417.4 m_ViewDataDictionary: {fileID: 0} m_OverlayCanvas: m_LastAppliedPresetName: Default @@ -745,16 +745,16 @@ MonoBehaviour: m_WindowGUID: cc27987af1a868c49b0894db9c0f5429 m_Gizmos: 0 m_OverrideSceneCullingMask: 6917529027641081856 - m_SceneIsLit: 1 + m_SceneIsLit: 0 m_SceneLighting: 1 m_2DMode: 0 m_isRotationLocked: 0 m_PlayAudio: 0 m_AudioPlay: 0 m_Position: - m_Target: {x: 12.319317, y: 1.3333886, z: 0.22287211} + m_Target: {x: 1.9768813, y: 1.8128467, z: 3.5595982} speed: 2 - m_Value: {x: 12.319317, y: 1.3333886, z: 0.22287211} + m_Value: {x: 1.9768813, y: 1.8128467, z: 3.5595982} m_RenderMode: 0 m_CameraMode: drawMode: 0 @@ -801,17 +801,17 @@ MonoBehaviour: m_GridAxis: 1 m_gridOpacity: 0.5 m_Rotation: - m_Target: {x: 0.27131104, y: -0.4891474, z: 0.16330287, w: 0.81269896} + m_Target: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} speed: 2 - m_Value: {x: 0.27130803, y: -0.48914197, z: 0.16330107, w: 0.81268996} + m_Value: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} m_Size: - m_Target: 0.8347519 + m_Target: 11.444273 speed: 2 - m_Value: 0.8347519 + m_Value: 11.444273 m_Ortho: - m_Target: 0 + m_Target: 1 speed: 2 - m_Value: 0 + m_Value: 1 m_CameraSettings: m_Speed: 1 m_SpeedNormalized: 0.5 @@ -854,8 +854,8 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 512 - width: 1268 - height: 271 + width: 1129.4 + height: 271.4 m_ViewDataDictionary: {fileID: 0} m_OverlayCanvas: m_LastAppliedPresetName: Default @@ -873,22 +873,22 @@ MonoBehaviour: m_SkipHidden: 0 m_SearchArea: 1 m_Folders: - - Assets/Objects/Weapons/M9 + - Assets/Scripts/GameManager m_Globs: [] m_OriginalText: m_ViewMode: 1 m_StartGridSize: 64 m_LastFolders: - - Assets/Objects/Weapons/M9 + - Assets/Scripts/GameManager m_LastFoldersGridSize: -1 - m_LastProjectPath: D:\.Downloads\Programming\Unity\Projects\Rheinmetall\3dshooter\3d-shooter + m_LastProjectPath: C:\Users\juliu\Desktop\Ausbildung\Fps-build\3d-shooter m_LockTracker: m_IsLocked: 0 m_FolderTreeState: - scrollPos: {x: 0, y: 120} - m_SelectedIDs: de630000 - m_LastClickedID: 25566 - m_ExpandedIDs: 00000000ba630000bc630000be630000c0630000c263000000ca9a3b + scrollPos: {x: 0, y: 116.600006} + m_SelectedIDs: 8c720000 + m_LastClickedID: 29324 + m_ExpandedIDs: 00000000726400007464000076640000547200005872000000ca9a3bffffff7f m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -916,7 +916,7 @@ MonoBehaviour: scrollPos: {x: 0, y: 0} m_SelectedIDs: m_LastClickedID: 0 - m_ExpandedIDs: 00000000ba630000bc630000be630000c0630000c2630000 + m_ExpandedIDs: 00000000726400007464000076640000 m_RenameOverlay: m_UserAcceptedRename: 0 m_Name: @@ -941,8 +941,8 @@ MonoBehaviour: m_Icon: {fileID: 0} m_ResourceFile: m_ListAreaState: - m_SelectedInstanceIDs: - m_LastClickedInstanceID: 0 + m_SelectedInstanceIDs: be7bffff + m_LastClickedInstanceID: -33858 m_HadKeyboardFocusLastEvent: 1 m_ExpandedInstanceIDs: c623000030660000986f0000d65e0000 m_RenameOverlay: @@ -994,8 +994,8 @@ MonoBehaviour: serializedVersion: 2 x: 0 y: 512 - width: 1268 - height: 271 + width: 1129.4 + height: 271.4 m_ViewDataDictionary: {fileID: 0} m_OverlayCanvas: m_LastAppliedPresetName: Default @@ -1020,10 +1020,10 @@ MonoBehaviour: m_Tooltip: m_Pos: serializedVersion: 2 - x: 1268.8 + x: 1130.4 y: 73.6 - width: 266 - height: 710 + width: 404.59998 + height: 709.8 m_ViewDataDictionary: {fileID: 0} m_OverlayCanvas: m_LastAppliedPresetName: Default