Network sync of difficulty corner info

This commit is contained in:
Pedro Gomes 2024-07-07 22:17:29 +01:00
parent e806551093
commit 67fb0cbba4
2 changed files with 19 additions and 0 deletions

View File

@ -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

View File

@ -10,6 +10,7 @@ public class GameDifficultyController : MonoBehaviour, IPunObservable
[SerializeField] private List<UnitDifficultySettings> difficultySettings = new List<UnitDifficultySettings>();
[Header("UI")]
[SerializeField] private Button gameDifficultySettingsButton;
[SerializeField] private List<GameObject> difficultyCornerInfo = new List<GameObject>();
[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);
}
}
}