From 556fdb60901bb8710e2dcd9ea102bd09be8c2521 Mon Sep 17 00:00:00 2001 From: trubkokrtek Date: Sun, 26 Apr 2026 13:12:21 +0200 Subject: [PATCH] Added task stations rendering --- Assets/GameManager/GameManager_Game.cs | 26 ++- .../com.unity.probuilder/Settings.json | 161 ++++++++++++++++++ 2 files changed, 186 insertions(+), 1 deletion(-) create mode 100644 ProjectSettings/Packages/com.unity.probuilder/Settings.json diff --git a/Assets/GameManager/GameManager_Game.cs b/Assets/GameManager/GameManager_Game.cs index 8737c85..68679d8 100644 --- a/Assets/GameManager/GameManager_Game.cs +++ b/Assets/GameManager/GameManager_Game.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; using UnityEngine; using static UnityEngine.Rendering.RayTracingAccelerationStructure; @@ -24,6 +25,7 @@ namespace Subsystems private float _range; private List _availableTasks; public List Stations { get; private set; } + public List TaskStations { get; private set; } = new List(); private StationSettings _stationSettings; public GameManager_Game(GameClient client, GameObject player, GameObject map, List availableTasks, float range = 20f, StationSettings stationSettings = null) { @@ -52,7 +54,16 @@ namespace Subsystems } } - public void InitializeStation(Position pos, StationType type) + public void InitializeTaskStations() + { + for(int i = 0; i < _gameClient.MyTasks.Count; i++) + { + System.Random rnd = new System.Random(); + var task = _availableTasks[rnd.Next(0,_availableTasks.Count)]; + CreateStation(_gameClient.MyTasks[i].Location, StationType.Task, _gameClient.MyTasks[i]); + } + } + private void CreateStation(Position pos, StationType type) { GameObject stationPrefab = null; PlayerRole? reqRole = null; @@ -61,6 +72,7 @@ namespace Subsystems case StationType.Task: stationPrefab = _stationSettings.TaskStationPrefab; reqRole = PlayerRole.Crew; + Debug.LogError("Task station creation not fully implemented, using task station prefab as placeholder"); break; case StationType.Sabotage: stationPrefab = _stationSettings.SabotageStationPrefab; @@ -96,6 +108,18 @@ namespace Subsystems Stations.Add(station); }*/ + } + private void CreateStation(Position pos, StationType type, GameTask taskInfo) + { + GameObject stationPrefab = _stationSettings.TaskStationPrefab; + var station = UnityEngine.Object.Instantiate(stationPrefab); + station.transform.position = pos.ToLocalVector3(_gameClient.CurrentLobbyState.MapData.Center); + Stations.Add(station); + TaskStation interactable = station.GetComponent(); + interactable.Location = pos; + interactable.InteractionRange = _range; + interactable.TaskID = taskInfo.TaskId; + } void CheckForPlayers() diff --git a/ProjectSettings/Packages/com.unity.probuilder/Settings.json b/ProjectSettings/Packages/com.unity.probuilder/Settings.json new file mode 100644 index 0000000..e371f41 --- /dev/null +++ b/ProjectSettings/Packages/com.unity.probuilder/Settings.json @@ -0,0 +1,161 @@ +{ + "m_Dictionary": { + "m_DictionaryValues": [ + { + "type": "UnityEngine.ProBuilder.LogLevel, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", + "key": "log.level", + "value": "{\"m_Value\":3}" + }, + { + "type": "UnityEngine.ProBuilder.LogOutput, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", + "key": "log.output", + "value": "{\"m_Value\":1}" + }, + { + "type": "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", + "key": "log.path", + "value": "{\"m_Value\":\"ProBuilderLog.txt\"}" + }, + { + "type": "UnityEngine.ProBuilder.SemVer, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", + "key": "about.identifier", + "value": "{\"m_Value\":{\"m_Major\":6,\"m_Minor\":0,\"m_Patch\":9,\"m_Build\":-1,\"m_Type\":\"\",\"m_Metadata\":\"\",\"m_Date\":\"\"}}" + }, + { + "type": "UnityEngine.ProBuilder.SemVer, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", + "key": "preferences.version", + "value": "{\"m_Value\":{\"m_Major\":6,\"m_Minor\":0,\"m_Patch\":9,\"m_Build\":-1,\"m_Type\":\"\",\"m_Metadata\":\"\",\"m_Date\":\"\"}}" + }, + { + "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", + "key": "ShapeComponent.ResetSettings", + "value": "{\"m_Value\":false}" + }, + { + "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", + "key": "mesh.newShapesSnapToGrid", + "value": "{\"m_Value\":true}" + }, + { + "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", + "key": "mesh.meshColliderIsConvex", + "value": "{\"m_Value\":false}" + }, + { + "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", + "key": "lightmapping.autoUnwrapLightmapUV", + "value": "{\"m_Value\":true}" + }, + { + "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", + "key": "editor.autoRecalculateCollisions", + "value": "{\"m_Value\":false}" + }, + { + "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", + "key": "experimental.enabled", + "value": "{\"m_Value\":false}" + }, + { + "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", + "key": "meshImporter.quads", + "value": "{\"m_Value\":true}" + }, + { + "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", + "key": "meshImporter.smoothing", + "value": "{\"m_Value\":true}" + }, + { + "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", + "key": "editor.autoUpdatePreview", + "value": "{\"m_Value\":false}" + }, + { + "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", + "key": "ShapeComponent.SettingsEnabled", + "value": "{\"m_Value\":false}" + }, + { + "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", + "key": "editor.backFaceSelectEnabled", + "value": "{\"m_Value\":false}" + }, + { + "type": "System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", + "key": "editor.showSceneInfo", + "value": "{\"m_Value\":false}" + }, + { + "type": "UnityEngine.Material, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", + "key": "mesh.userMaterial", + "value": "{\"m_Value\":{\"instanceID\":0}}" + }, + { + "type": "UnityEngine.Rendering.ShadowCastingMode, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", + "key": "mesh.shadowCastingMode", + "value": "{\"m_Value\":1}" + }, + { + "type": "UnityEditor.StaticEditorFlags, UnityEditor.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", + "key": "mesh.defaultStaticEditorFlags", + "value": "{\"m_Value\":0}" + }, + { + "type": "UnityEngine.ProBuilder.ColliderType, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", + "key": "mesh.newShapeColliderType", + "value": "{\"m_Value\":2}" + }, + { + "type": "UnityEngine.ProBuilder.UnwrapParameters, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", + "key": "lightmapping.defaultLightmapUnwrapParameters", + "value": "{\"m_Value\":{\"m_HardAngle\":88.0,\"m_PackMargin\":20.0,\"m_AngleError\":8.0,\"m_AreaError\":15.0}}" + }, + { + "type": "UnityEngine.ProBuilder.SelectMode, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", + "key": "s_SelectMode", + "value": "{\"m_Value\":4}" + }, + { + "type": "System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", + "key": "meshImporter.smoothingAngle", + "value": "{\"m_Value\":1.0}" + }, + { + "type": "System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", + "key": "BevelEdges.size", + "value": "{\"m_Value\":0.20000000298023225}" + }, + { + "type": "System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", + "key": "ShapeBuilder.ActiveShapeIndex", + "value": "{\"m_Value\":6}" + }, + { + "type": "UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", + "key": "ShapeBuilder.LastSize.Cube", + "value": "{\"m_Value\":{\"x\":-1.2792290449142457,\"y\":-15.89394760131836,\"z\":-1.322575569152832}}" + }, + { + "type": "UnityEngine.Quaternion, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", + "key": "ShapeBuilder.LastRotation.Cube", + "value": "{\"m_Value\":{\"x\":0.0,\"y\":0.0,\"z\":0.0,\"w\":1.0}}" + }, + { + "type": "UnityEngine.ProBuilder.PivotLocation, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", + "key": "ShapeBuilder.PivotLocation.Cube", + "value": "{\"m_Value\":0}" + }, + { + "type": "UnityEngine.ProBuilder.Shapes.Shape, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", + "key": "ShapeBuilder.Cube", + "value": "{}" + }, + { + "type": "UnityEngine.ProBuilder.RectSelectMode, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", + "key": "editor.dragSelectRectMode", + "value": "{\"m_Value\":0}" + } + ] + } +} \ No newline at end of file