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

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