mp fundementals and turn timer
This commit is contained in:
@@ -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>();
|
||||
|
||||
Reference in New Issue
Block a user