Esempio n. 1
0
    // 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));
        }
    }
Esempio n. 2
0
    // 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>();
            }
        }
    }
Esempio n. 3
0
    // Use this for initialization
    void Start()
    {
        playersContainer = GameObject.Find("Runner/Players");

        gPlayerInfo = FindObjectOfType <GlobalPlayerInfo>();
        if (gPlayerInfo != null)
        {
            singlePlayerMode = gPlayerInfo.NumPlayers == 1;
        }
    }
Esempio n. 4
0
    // 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>();
    }
Esempio n. 5
0
    // 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;
    }
Esempio n. 6
0
 // Use this for initialization
 void Start()
 {
     gPlayerInfo = FindObjectOfType <GlobalPlayerInfo>();
 }