Browse Source

reorganized

combinedRaceAndNameDropper
Josh 2 years ago
parent
commit
ecfabc8651
  1. 2
      namedropper/Assets/Scenes/Title.unity
  2. 0
      namedropper/Assets/Scripts/Calibration.cs
  3. 0
      namedropper/Assets/Scripts/Calibration.cs.meta
  4. 0
      namedropper/Assets/Scripts/CalibrationBox.cs
  5. 0
      namedropper/Assets/Scripts/CalibrationBox.cs.meta
  6. 3
      namedropper/Assets/Scripts/Category.cs
  7. 18
      namedropper/Assets/Scripts/Game.cs
  8. 22
      namedropper/Assets/Scripts/GameManager.cs
  9. 0
      namedropper/Assets/Scripts/GameOverScreen.cs
  10. 0
      namedropper/Assets/Scripts/GameOverScreen.cs.meta
  11. 3
      namedropper/Assets/Scripts/Join.cs
  12. 0
      namedropper/Assets/Scripts/Join.cs.meta
  13. 0
      namedropper/Assets/Scripts/JoinGameBox.cs
  14. 0
      namedropper/Assets/Scripts/JoinGameBox.cs.meta
  15. 1
      namedropper/Assets/Scripts/JoinPlayer.cs
  16. 0
      namedropper/Assets/Scripts/JoinPlayer.cs.meta
  17. 0
      namedropper/Assets/Scripts/NumPlayerPicker.cs
  18. 0
      namedropper/Assets/Scripts/NumPlayerPicker.cs.meta
  19. 2
      namedropper/Assets/Scripts/Player.cs
  20. 0
      namedropper/Assets/Scripts/Replay.cs
  21. 0
      namedropper/Assets/Scripts/Replay.cs.meta
  22. 0
      namedropper/Assets/Scripts/RoundIntro.cs
  23. 0
      namedropper/Assets/Scripts/RoundIntro.cs.meta
  24. 0
      namedropper/Assets/Scripts/RoundOutro.cs
  25. 0
      namedropper/Assets/Scripts/RoundOutro.cs.meta
  26. 0
      namedropper/Assets/Scripts/ScoreStack.cs
  27. 0
      namedropper/Assets/Scripts/ScoreStack.cs.meta
  28. 0
      namedropper/Assets/Scripts/TrackballInputManager.cs
  29. 0
      namedropper/Assets/Scripts/TrackballInputManager.cs.meta

2
namedropper/Assets/Scenes/Title.unity

@ -291,7 +291,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 4 players ready
m_text: best with 4 players
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 4fe6d5308385b4341885d0d510c8e2aa, type: 2}
m_sharedMaterial: {fileID: 1001970574707011636, guid: 4fe6d5308385b4341885d0d510c8e2aa, type: 2}

0
namedropper/Assets/Calibration.cs → namedropper/Assets/Scripts/Calibration.cs

0
namedropper/Assets/Calibration.cs.meta → namedropper/Assets/Scripts/Calibration.cs.meta

0
namedropper/Assets/CalibrationBox.cs → namedropper/Assets/Scripts/CalibrationBox.cs

0
namedropper/Assets/CalibrationBox.cs.meta → namedropper/Assets/Scripts/CalibrationBox.cs.meta

3
namedropper/Assets/Scripts/Category.cs

@ -95,7 +95,10 @@ public class Category : MonoBehaviour
string retVal = WorkingElements[index];
WorkingElements.RemoveAt(index);
if (WorkingElements.Count == 0)
{
Debug.Log("used up all elements");
ResetElements();
}
return retVal;

18
namedropper/Assets/Scripts/Game.cs

@ -161,10 +161,26 @@ public class Game : Level
}
void ActivatePlayers(bool value)
{
if (value == false)
{
foreach (GameObject player in _players)
{
player.SetActive(value);
player.SetActive(false);
}
}
else //value = true
{
foreach (GameObject player in _players)
{
if (GameManager.Instance.PlayerJoined[player.GetComponent<Player>()._playerNumber] == true ||
SceneManager.GetActiveScene().name == "PlayerSelectJoin")
{
player.SetActive(true);
}
}
}
}
IEnumerator Countdown()

22
namedropper/Assets/Scripts/GameManager.cs

@ -5,6 +5,7 @@ using UnityEngine.SceneManagement;
using YamlDotNet.Serialization;
using YamlDotNet.Serialization.NamingConventions;
using System.IO;
using System.Runtime.InteropServices.WindowsRuntime;
public class GameManager
{
@ -16,8 +17,8 @@ public class GameManager
int _score4 = 0;
int _highScore = 0;
int _round = 1;
int _numPlayers;
bool _competitive = true;
public bool[] PlayerJoined = new bool[4];
public static int PLAYER_SKIN = 5; //0 == puck, 1 == pancake, 2 == gummybear, 3==pig, 4==ball w/ bear, 5==pop
public static int MAX_PLAYER_SKIN = 5;
@ -46,6 +47,11 @@ public class GameManager
Score3 = 0;
Score4 = 0;
Round = 1;
for (int i = 0; i < 4; i++)
{
PlayerJoined[i] = false;
}
}
public void RestartGame()
@ -75,6 +81,18 @@ public class GameManager
public int Score4 { get => _score4; set => _score4 = value; }
public int Round { get => _round; set => _round = value; }
public int HighScore { get => _highScore; set => _highScore = value; }
public int NumPlayers { get => _numPlayers; set => _numPlayers = value; }
public int NumPlayers {
get {
int retVal = 0;
foreach (bool b in PlayerJoined)
{
if (b == true)
{
retVal++;
}
}
return retVal;
}
}
public bool Competitive { get => _competitive; set => _competitive = value; }
}

0
namedropper/Assets/GameOverScreen.cs → namedropper/Assets/Scripts/GameOverScreen.cs

0
namedropper/Assets/GameOverScreen.cs.meta → namedropper/Assets/Scripts/GameOverScreen.cs.meta

3
namedropper/Assets/Join.cs → namedropper/Assets/Scripts/Join.cs

@ -2,6 +2,7 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using static UnityEditor.Experimental.GraphView.GraphView;
public class Join : MonoBehaviour
{
@ -26,7 +27,7 @@ public class Join : MonoBehaviour
void UpdateText()
{
_numPlayersReadyText.text = NumPlayersReady + " players ready";
//_numPlayersReadyText.text = NumPlayersReady + " players ready";
}
// Update is called once per frame
void Update()

0
namedropper/Assets/Join.cs.meta → namedropper/Assets/Scripts/Join.cs.meta

0
namedropper/Assets/JoinGameBox.cs → namedropper/Assets/Scripts/JoinGameBox.cs

0
namedropper/Assets/JoinGameBox.cs.meta → namedropper/Assets/Scripts/JoinGameBox.cs.meta

1
namedropper/Assets/JoinPlayer.cs → namedropper/Assets/Scripts/JoinPlayer.cs

@ -39,6 +39,7 @@ public class JoinPlayer : MonoBehaviour
void StartTimer()
{
_timer = 10;
UpdateTitle();
Invoke("Countdown", 1f);
}

0
namedropper/Assets/JoinPlayer.cs.meta → namedropper/Assets/Scripts/JoinPlayer.cs.meta

0
namedropper/Assets/NumPlayerPicker.cs → namedropper/Assets/Scripts/NumPlayerPicker.cs

0
namedropper/Assets/NumPlayerPicker.cs.meta → namedropper/Assets/Scripts/NumPlayerPicker.cs.meta

2
namedropper/Assets/Scripts/Player.cs

@ -67,6 +67,7 @@ public class Player : MonoBehaviour
_originalPosition = transform.position;
if (GameManager.Instance.NumPlayers == 1)
{
if (_playerNumber != 1)
@ -285,6 +286,7 @@ public class Player : MonoBehaviour
jp.Join();
this.gameObject.SetActive(false);
GameManager.Instance.PlayerJoined[_playerNumber] = true;
//StartCountdown();
//if (_joinedPlayers)

0
namedropper/Assets/Replay.cs → namedropper/Assets/Scripts/Replay.cs

0
namedropper/Assets/Replay.cs.meta → namedropper/Assets/Scripts/Replay.cs.meta

0
namedropper/Assets/RoundIntro.cs → namedropper/Assets/Scripts/RoundIntro.cs

0
namedropper/Assets/RoundIntro.cs.meta → namedropper/Assets/Scripts/RoundIntro.cs.meta

0
namedropper/Assets/RoundOutro.cs → namedropper/Assets/Scripts/RoundOutro.cs

0
namedropper/Assets/RoundOutro.cs.meta → namedropper/Assets/Scripts/RoundOutro.cs.meta

0
namedropper/Assets/ScoreStack.cs → namedropper/Assets/Scripts/ScoreStack.cs

0
namedropper/Assets/ScoreStack.cs.meta → namedropper/Assets/Scripts/ScoreStack.cs.meta

0
namedropper/Assets/TrackballInputManager.cs → namedropper/Assets/Scripts/TrackballInputManager.cs

0
namedropper/Assets/TrackballInputManager.cs.meta → namedropper/Assets/Scripts/TrackballInputManager.cs.meta

Loading…
Cancel
Save