void Start() { PlayerNickname = PhotonNetwork.LocalPlayer.NickName; if (SceneManager.GetActiveScene().name.Equals("RoomLobby2Players") || SceneManager.GetActiveScene().name.Equals("RoomLobby3Players") || SceneManager.GetActiveScene().name.Equals("RoomLobby4Players")) { playerSpriteRenderer = this.gameObject.GetComponent <SpriteRenderer>(); PlayerNicknameText.text = PlayerPhotonView.Owner.NickName; if (PlayerPhotonView.Owner.NickName == PlayerNickname) { PlayerNicknameText.fontStyle = FontStyle.Bold; } } else if (SceneManager.GetActiveScene().name.Equals("Gameplay")) { PlayerUICanvas.gameObject.SetActive(false); gameplayManager = GameObject.Find("GameManager").GetComponent <GameplayManager>(); newDice = GameObject.Find("Dice").GetComponent <NewDice>(); cardManager = GameObject.Find("CardManager").GetComponent <CardManager>(); pointBar = GameObject.Find("Pointbar").GetComponent <PointBar>(); this.gameObject.transform.localScale = gameplayManager.Player1SpawnLocation.transform.localScale; } }
// Update is called once per frame void Update() { if (PlayerPointbarObject != null && IsGotPlayerPointbarObject == false) { pointBar = PlayerPointbarObject.GetComponent <PointBar>(); IsGotPlayerPointbarObject = true; } if (IsReadyPutItem) { PutItemOnBoard(); } }
private void OnEnable() { m_PointBar = (PointBar)target; }