From 67fb0cbba49773f429e3f83afa19ad18dded9f9c Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Sun, 7 Jul 2024 22:17:29 +0100 Subject: [PATCH] Network sync of difficulty corner info --- Assets/Developer/Prefabs/Persistent Objects.prefab | 7 +++++++ .../Scripts/Difficulty/GameDifficultyController.cs | 12 ++++++++++++ 2 files changed, 19 insertions(+) diff --git a/Assets/Developer/Prefabs/Persistent Objects.prefab b/Assets/Developer/Prefabs/Persistent Objects.prefab index b7135674..f2fd5e03 100644 --- a/Assets/Developer/Prefabs/Persistent Objects.prefab +++ b/Assets/Developer/Prefabs/Persistent Objects.prefab @@ -3564,6 +3564,13 @@ MonoBehaviour: - {fileID: 11400000, guid: a5b6144c39ac3694bbb0a27e5b60a502, type: 2} - {fileID: 11400000, guid: 5161dd406f425134a90d08d768fd9bae, type: 2} gameDifficultySettingsButton: {fileID: 7063713923528376298} + difficultyCornerInfo: + - {fileID: 6836046563900620425} + - {fileID: 3620004931301168176} + - {fileID: 115788525699260801} + - {fileID: 5146934741504305320} + - {fileID: 5958990067708242587} + - {fileID: 7288627801948695799} onDifficultyChanged: {fileID: 11400000, guid: 247e3b83af42801498c7ee30029a8b8a, type: 2} onJoinedRoom: {fileID: 741966922129695396} --- !u!1 &7475116342785696727 diff --git a/Assets/Scripts/Difficulty/GameDifficultyController.cs b/Assets/Scripts/Difficulty/GameDifficultyController.cs index 957e0204..71f56cb8 100644 --- a/Assets/Scripts/Difficulty/GameDifficultyController.cs +++ b/Assets/Scripts/Difficulty/GameDifficultyController.cs @@ -10,6 +10,7 @@ public class GameDifficultyController : MonoBehaviour, IPunObservable [SerializeField] private List difficultySettings = new List(); [Header("UI")] [SerializeField] private Button gameDifficultySettingsButton; + [SerializeField] private List difficultyCornerInfo = new List(); [Header("Events:")] [SerializeField] private GameEvent onDifficultyChanged; [Header("Listeners:")] @@ -159,4 +160,15 @@ public class GameDifficultyController : MonoBehaviour, IPunObservable Debug.Log($"Networked Difficulty: Set to {difficultySettings[currentDifficultyIndex].name}"); } } + + private void ToggleDifficultyCornerInfo(int index) + { + difficultyCornerInfo[index].SetActive(true); + + for (int i = 0; i < difficultyCornerInfo.Count; i++) + { + if (i == index) continue; + difficultyCornerInfo[i].SetActive(false); + } + } }