You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
853 B

  1. using UnityEngine;
  2. using System.Collections;
  3. public class sceneController : MonoBehaviour {
  4. public GameObject player1;
  5. public GameObject player2;
  6. public GameObject player3;
  7. public GameObject player4;
  8. public levelController control;
  9. private int playerCount;
  10. // Use this for initialization
  11. void Start () {
  12. control = GameObject.FindGameObjectWithTag ("GameController").GetComponent<levelController> ();
  13. player1.SetActive (false);
  14. player2.SetActive (false);
  15. player3.SetActive (false);
  16. player4.SetActive (false);
  17. playerCount = control.playerCount;
  18. if (playerCount >= 1)
  19. player1.SetActive (true);
  20. if (playerCount >= 2)
  21. player2.SetActive (true);
  22. if (playerCount >= 3)
  23. player3.SetActive (true);
  24. if (playerCount >= 4)
  25. player4.SetActive (true);
  26. }
  27. // Update is called once per frame
  28. void Update () {
  29. }
  30. }