public bool SetRoeier() { foreach (GameObject go in GameObject.FindGameObjectsWithTag("PhotonPlayer")) if (go.GetComponent<PhotonRoeier>().PaddleViewId != 0) { this.Roeier = go.GetComponent<PhotonRoeier>(); break; } if (this.Roeier == null) GameObject.Find("Push").SetActive(false); return this.Roeier != null; }
public void AssignPlayer(PhotonRoeier player) { Paddle nextPaddle = this.NextPaddle; player.PaddleViewId = nextPaddle.gameObject.GetPhotonView().viewID; this._paddles.Remove(nextPaddle); this._nextPaddle = null; }
public void RemovePlayer(PhotonRoeier player) { Paddle freePaddle = PhotonView.Find(player.PaddleViewId).gameObject.GetComponent<Paddle>(); this._paddles.Add(freePaddle); }