Browse Source

fixed 4-player

A
Josh 2 years ago
parent
commit
997b9ed331
  1. 2344
      namedropper/Assets/Scenes/Game.unity
  2. 11
      namedropper/Assets/Scripts/Game.cs
  3. 12
      namedropper/Assets/Scripts/Player.cs

2344
namedropper/Assets/Scenes/Game.unity

File diff suppressed because it is too large

11
namedropper/Assets/Scripts/Game.cs

@ -13,11 +13,22 @@ public class Game : MonoBehaviour
[SerializeField] Text Score4; [SerializeField] Text Score4;
[SerializeField] Text Timer; [SerializeField] Text Timer;
[SerializeField] GameObject CategoriesRound1;
[SerializeField] GameObject CategoriesRound2;
[SerializeField] GameObject CategoriesRound3;
Category[] _categories; Category[] _categories;
int _originalFontSize; int _originalFontSize;
// Start is called before the first frame update // Start is called before the first frame update
void Awake() void Awake()
{ {
if (GameManager.Instance.Round == 1)
CategoriesRound1.SetActive(true);
else if (GameManager.Instance.Round == 2)
CategoriesRound2.SetActive(true);
else if (GameManager.Instance.Round == 3)
CategoriesRound3.SetActive(true);
_originalFontSize = Timer.fontSize; _originalFontSize = Timer.fontSize;
_categories = FindObjectsOfType<Category>(); _categories = FindObjectsOfType<Category>();

12
namedropper/Assets/Scripts/Player.cs

@ -78,21 +78,15 @@ public class Player : MonoBehaviour
} }
else if (GameManager.Instance.NumPlayers == 4 && GameManager.Instance.Competitive) else if (GameManager.Instance.NumPlayers == 4 && GameManager.Instance.Competitive)
{ {
//player 1 remains on team 1 //player 1 & 2 remain on team 1
if (_playerNumber == 2)
{
gameObject.layer = LayerMask.NameToLayer("Team 2");
}
if (_playerNumber == 3) if (_playerNumber == 3)
{ {
gameObject.layer = LayerMask.NameToLayer("Team 3"); gameObject.layer = LayerMask.NameToLayer("Team 2");
} }
if (_playerNumber == 4) if (_playerNumber == 4)
{ {
gameObject.layer = LayerMask.NameToLayer("Team 4"); gameObject.layer = LayerMask.NameToLayer("Team 2");
} }
} }
} }

Loading…
Cancel
Save