using UnityEngine;
|
|
using System.Collections;
|
|
|
|
public class sceneController : MonoBehaviour {
|
|
|
|
public GameObject player1;
|
|
public GameObject player2;
|
|
public GameObject player3;
|
|
public GameObject player4;
|
|
public levelController control;
|
|
private int playerCount;
|
|
|
|
private playerController playerScript1;
|
|
private playerController playerScript2;
|
|
private playerController playerScript3;
|
|
private playerController playerScript4;
|
|
// Use this for initialization
|
|
|
|
void Awake(){
|
|
playerScript1 = player1.GetComponent<playerController> ();
|
|
playerScript2 = player2.GetComponent<playerController> ();
|
|
playerScript3 = player3.GetComponent<playerController> ();
|
|
playerScript4 = player4.GetComponent<playerController> ();
|
|
|
|
}
|
|
|
|
void Start () {
|
|
control = GameObject.FindGameObjectWithTag ("GameController").GetComponent<levelController> ();
|
|
|
|
player1.SetActive (false);
|
|
player2.SetActive (false);
|
|
player3.SetActive (false);
|
|
player4.SetActive (false);
|
|
|
|
playerCount = control.playerCount;
|
|
if (playerCount >= 1)
|
|
player1.SetActive (true);
|
|
if (playerCount >= 2)
|
|
player2.SetActive (true);
|
|
if (playerCount >= 3)
|
|
player3.SetActive (true);
|
|
if (playerCount >= 4)
|
|
player4.SetActive (true);
|
|
|
|
playerScript1.maxScore = control.maxScore;
|
|
playerScript2.maxScore = control.maxScore;
|
|
playerScript3.maxScore = control.maxScore;
|
|
playerScript4.maxScore = control.maxScore;
|
|
|
|
playerScript1.confettiOnHit = control.confetti;
|
|
playerScript2.confettiOnHit = control.confetti;
|
|
playerScript3.confettiOnHit = control.confetti;
|
|
playerScript4.confettiOnHit = control.confetti;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update () {
|
|
|
|
}
|
|
}
|