Organize custom scripts under Assets/Baba_yaga and merge Opsive folders to Assets root

This commit is contained in:
2026-07-01 20:32:28 +07:00
parent 83d4157ac6
commit befc19bf37
5901 changed files with 243 additions and 141 deletions

View File

@@ -0,0 +1,37 @@
using Fusion;
using TMPro;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class GameManager : NetworkBehaviour
{
public Text gameOverText; // Reference to the Game Over text UI element
private bool isGameOver = false; // Flag to check if the game is over
private void Start() {
if (gameOverText != null) {
// Ensure the Game Over text is hidden at the start of the game
gameOverText.gameObject.SetActive(false);
}
}
[SerializeField] private Baba_yaga.Network.MatchEloManager eloManager;
public void TriggerGameOver(PlayerRef winner, PlayerRef loser, bool isDraw = false) {
if (!isGameOver) {
isGameOver = true;
if (gameOverText != null) {
gameOverText.gameObject.SetActive(true);
}
// Only Host processes Elo
if (Runner.IsServer && eloManager != null) {
eloManager.ProcessMatchResult(winner, loser, isDraw);
}
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 1180f4b733c7599498f6eb4e77848e23