using System.Collections; using System.Collections.Generic; using UnityEngine; using Photon.Realtime; using Photon.Pun; using Photon.Pun.UtilityScripts; public class GameManager : MonoBehaviourPunCallbacks { public GameObject[] spawnPointsBlue; public GameObject[] spawnPointsRed; public Player[] meinTeamArray; [SerializeField] private PhotonTeamsManager pt; void Awake() { if (PhotonNetwork.IsConnected) { //Wichtig!!!! Die Custom Propertie für das Team heisst: "_pt" und ist bei Team Blau 1 und bei Team Rot 2!!!!! if (PhotonNetwork.LocalPlayer.CustomProperties[1] == "_pt") { Debug.Log("PhotonNetwork.LocalPlayer.CustomProperties[1] == _pt" + " war richtig"); } if (PhotonNetwork.LocalPlayer.CustomProperties["_pt"] == "1") { Debug.Log("PhotonNetwork.LocalPlayer.CustomProperties[_pt] == 1" + " war richtig"); } if (PhotonNetwork.LocalPlayer.CustomProperties[2] == "_pt") { Debug.Log("PhotonNetwork.LocalPlayer.CustomProperties[2] == _pt" + " war richtig"); } if (PhotonNetwork.LocalPlayer.CustomProperties["_pt"] == "2") { Debug.Log("PhotonNetwork.LocalPlayer.CustomProperties[_pt] == 2" + " war richtig"); } /* //Team als int bekommen: var team = PhotonNetwork.LocalPlayer.CustomProperties["_pt"]; if ((int)team == 1) { //Blau float Z = Random.Range(-231, 72); PhotonNetwork.Instantiate("Player", new Vector3(-1100, 320, Z), Quaternion.identity); } if ((int)team == 2) { //Rot float Z = Random.Range(-231, 72); PhotonNetwork.Instantiate("Player", new Vector3(515, 320, Z), Quaternion.identity); } */ } } }