public void HideAvatars() { foreach (Player player in gmm.GetActivePlayers()) { player.HideAvatar(); } }
private void SpawnFigurines() { for (int i = 1; i < gmm.GetActivePlayers().Count; i++) { Vector3 pos = availableSpawns[i - 1].transform.position; pos.y += 0.5f; figurine.GetComponentInChildren <RotateCanvas>().target = targetTransform; figurine.GetComponentInChildren <Canvas>().worldCamera = eventCamera; figurine.GetComponentInChildren <OVRRaycaster>().pointer = pointer; GameObject figurine_tmp = Instantiate(figurine, pos, Quaternion.identity, transformFigurines) as GameObject; figurine_tmp.transform.GetChild(0).GetComponent <Renderer>().material = gmm.GetActivePlayers()[i].playerColor; gmm.GetActivePlayers()[i].AddFigurine(figurine_tmp); gmm.GetActivePlayers()[0].AddFigurine(figurine_tmp); } }
// This needs to be called after the players have been spawned in public void OnEnable() { tableTransform = GameObject.FindWithTag("Table").transform; turnQueue = new Dictionary <int, Player>(); gmm = GameObject.FindWithTag("GameMaster").GetComponent <GameMasterManager>(); pof = GameObject.FindWithTag("Player").GetComponentInChildren <PlayerOwnedFigurines>(); SetActivePlayer(gmm.GetActivePlayers()[0]); InitTurnQueue(); nextPlayer = 1; isGM = true; mainCamera = Camera.main; }
public void Update() { if ((Input.GetButtonDown("Fire3") || Input.GetButtonDown("Oculus_GearVR_LThumbstickX")) && !isGMMode) { ActivateGMMode(); } else if ((Input.GetButtonDown("Fire3") || Input.GetButtonDown("Oculus_GearVR_LThumbstickX")) && isGMMode) { if (gmm.GetActivePlayers().Count > 1) { DeactivateGMMode(); } } }
public void ChangePlayer() { isGM = false; SetActivePlayer(turnQueue[nextPlayer]); SetPosition(); UpdatePlayerAvatar(); nextPlayer = (nextPlayer + 1) % gmm.GetActivePlayers().Count; //Since turnQueue doesn't have the key 0 if (nextPlayer == 0) { nextPlayer = 1; } //change later to make dependencies better pof.ChangeOwnedFigurines(gmm.GetActivePlayers()[FindPlayer(activePlayer)].GetOwnedFigurines()); mainCamera.cullingMask = ~(1 << 15); text.text = "Current player: " + activePlayer.playerColor.name; }