mp fundementals and turn timer

This commit is contained in:
2026-02-14 18:18:45 +05:30
parent 614c38bdaf
commit 02dee0b86d
64 changed files with 7472 additions and 82 deletions
+8 -3
View File
@@ -1,12 +1,15 @@
using Mirror;
using UnityEngine;
public class Goal : MonoBehaviour
public class Goal : NetworkBehaviour
{
public Team team;
void OnTriggerEnter2D(Collider2D collision)
{
{
if(!isServer){return;}
if(collision.gameObject.CompareTag("Player")){
Debug.Log($"GOAL! {team.ToString()}", gameObject);
Debug.Log($"GOAL! {team}", gameObject);
Ball ball = collision.gameObject.GetComponent<Ball>();
Debug.Log(ball.name);
GameManager.instance.OnGoal(team);
@@ -20,6 +23,8 @@ public class Goal : MonoBehaviour
void OnTriggerExit2D(Collider2D collision)
{
if(!isServer){return;}
if(collision.gameObject.CompareTag("Puck")){
Debug.Log("Puck exit goal", gameObject);
Puck puck = collision.gameObject.GetComponent<Puck>();