// Use this for initialization void Start() { GameObject voObj = GameObject.FindGameObjectWithTag("NarrationPlayer"); GlobalPlayerInfo gPlayerInfo = FindObjectOfType <GlobalPlayerInfo>(); if (voObj == null || gPlayerInfo == null) { return; } if (gPlayerInfo.GetComponent <RoundManager>().CurrentRound > 3) { return; } voSource = voObj.GetComponent <AudioSource>(); int winningPlayer = gPlayerInfo.GetWinningPlayer().GetComponent <PlayerInfo>().PlayerNum; int losingPlayer = gPlayerInfo.GetLosingPlayer().GetComponent <PlayerInfo>().PlayerNum; AudioClip winningClip = LeaderClips[winningPlayer - 1]; AudioClip losingClip = LoserClips[losingPlayer - 1]; StartCoroutine(PlayDelayed( winningClip, Delay)); if (gPlayerInfo.NumPlayers > 1) { StartCoroutine(PlayDelayed( losingClip, Delay + winningClip.length + LoserDelay)); } }
// Use this for initialization void Start() { GameObject[] players = GameObject.FindGameObjectsWithTag("Player"); gPlayerInfo = FindObjectOfType <GlobalPlayerInfo>(); if (gPlayerInfo != null) { playerScore = gPlayerInfo.GetPlayerScore(Player); if (!gPlayerInfo.HasPlayer(Player)) { GameObject.Destroy(this.gameObject); return; } hexColor = Palette.GetHex(gPlayerInfo.GetPlayerColor(Player)); } //default to minigame local score if it exists for (int i = 0; i < players.Length; i++) { if (players[i].GetComponent <PlayerInfo>().PlayerNum == Player) { playerScore = players[i].GetComponent <PlayerScore>(); } } }
// Use this for initialization void Start() { playersContainer = GameObject.Find("Runner/Players"); gPlayerInfo = FindObjectOfType <GlobalPlayerInfo>(); if (gPlayerInfo != null) { singlePlayerMode = gPlayerInfo.NumPlayers == 1; } }
// Use this for initialization void Start() { //get player score scripts and order by player number scores = GameObject.FindObjectsOfType <PlayerScore>(); scores = (from obj in scores orderby obj.GetComponent <PlayerInfo>().PlayerNum select obj).ToArray(); gPlayerInfo = FindObjectOfType <GlobalPlayerInfo>(); }
// Use this for initialization void Start() { //get GlobalPlayerInfo if it exists gPlayerInfo = FindObjectOfType <GlobalPlayerInfo>(); //get attached NextScene component nextScene = GetComponent <NextScene>(); if (nextScene == null) { Debug.LogError("No NextScene script attached to this object!"); } currentHoldTime = HoldTime; }
// Use this for initialization void Start() { gPlayerInfo = FindObjectOfType <GlobalPlayerInfo>(); }