Browse Source

plexi control panel and calibration (untested)

combinedRaceAndNameDropper
Josh 2 years ago
parent
commit
fda150a532
  1. 22
      namedropper/Assets/Calibration.cs
  2. 11
      namedropper/Assets/Calibration.cs.meta
  3. 28
      namedropper/Assets/CalibrationBox.cs
  4. 11
      namedropper/Assets/CalibrationBox.cs.meta
  5. 5
      namedropper/Assets/Join.cs
  6. 3451
      namedropper/Assets/Scenes/Calibration.unity
  7. 7
      namedropper/Assets/Scenes/Calibration.unity.meta
  8. 29
      namedropper/Assets/Scenes/Game.unity
  9. 24
      namedropper/Assets/Scenes/TopicSelect.unity
  10. 29
      namedropper/Assets/Scripts/Player.cs
  11. 16
      namedropper/Assets/Scripts/TopicSelect.cs
  12. 2
      namedropper/Assets/Scripts/Wraparound.cs
  13. 32
      namedropper/Assets/TrackballInputManager.cs
  14. 3
      namedropper/ProjectSettings/EditorBuildSettings.asset
  15. 7095
      original art assets/plexi control panel.ai

22
namedropper/Assets/Calibration.cs

@ -0,0 +1,22 @@
using UnityEngine.SceneManagement;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Calibration : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (FindObjectsOfType<CalibrationBox>() == null)
{
SceneManager.LoadScene("Title");
}
}
}

11
namedropper/Assets/Calibration.cs.meta

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2c72e82c7e9c14c4d9c35c479147c3aa
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

28
namedropper/Assets/CalibrationBox.cs

@ -0,0 +1,28 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CalibrationBox : MonoBehaviour
{
[SerializeField] int _playerNumber;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void Calibrate(int? DeviceId)
{
if (DeviceId != null) {
TrackballInputManager.Calibrate(_playerNumber,(int)DeviceId);
GameObject.Destroy(this.gameObject);
}
}
}

11
namedropper/Assets/CalibrationBox.cs.meta

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 578446f45e430194591de814a100d806
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

5
namedropper/Assets/Join.cs

@ -78,6 +78,11 @@ public class Join : MonoBehaviour
{ {
NumPlayersReady = 4; NumPlayersReady = 4;
} }
if (Input.GetKeyDown(KeyCode.C))
{
SceneManager.LoadScene("Calibration");
}
} }
void StartGame() void StartGame()

3451
namedropper/Assets/Scenes/Calibration.unity

File diff suppressed because it is too large

7
namedropper/Assets/Scenes/Calibration.unity.meta

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1cdfc7379ea90c34e8ce5d94b5b43e30
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

29
namedropper/Assets/Scenes/Game.unity

@ -375,7 +375,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338377, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338377, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: _playerNumber propertyPath: _playerNumber
value: 2 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338377, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338377, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: _spriteOptions.Array.size propertyPath: _spriteOptions.Array.size
@ -431,7 +431,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_AnchorMax.x propertyPath: m_AnchorMax.x
@ -1242,7 +1242,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338377, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338377, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: _playerNumber propertyPath: _playerNumber
value: 4 value: 2
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338377, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338377, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: _spriteOptions.Array.size propertyPath: _spriteOptions.Array.size
@ -1306,7 +1306,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 3 value: 2
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_AnchorMax.x propertyPath: m_AnchorMax.x
@ -3599,6 +3599,11 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: c2999330b51cf4c409e52d0a60d0be86, type: 3} m_Script: {fileID: 11500000, guid: c2999330b51cf4c409e52d0a60d0be86, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
_players:
- {fileID: 1791992020}
- {fileID: 23812149}
- {fileID: 707823885}
- {fileID: 1777639902}
Score1: {fileID: 1957998283} Score1: {fileID: 1957998283}
Score2: {fileID: 1042264265} Score2: {fileID: 1042264265}
Score3: {fileID: 119717092} Score3: {fileID: 119717092}
@ -3609,11 +3614,6 @@ MonoBehaviour:
CategoriesRound1: {fileID: 554321082} CategoriesRound1: {fileID: 554321082}
CategoriesRound2: {fileID: 1146299634} CategoriesRound2: {fileID: 1146299634}
CategoriesRound3: {fileID: 1391939818} CategoriesRound3: {fileID: 1391939818}
_players:
- {fileID: 1791992020}
- {fileID: 23812149}
- {fileID: 707823885}
- {fileID: 1777639902}
--- !u!4 &1641253473 --- !u!4 &1641253473
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -3652,9 +3652,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 70de4eb8e48bea54b864b5d20448ee50, type: 3} m_Script: {fileID: 11500000, guid: 70de4eb8e48bea54b864b5d20448ee50, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
defaultMiceSensitivity: 1
accelerationThreshold: 40
accelerationMultiplier: 2
_players: _players:
- {fileID: 1791992025} - {fileID: 1791992025}
- {fileID: 23812154} - {fileID: 23812154}
@ -4314,10 +4311,10 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: m_Children:
- {fileID: 554720354}
- {fileID: 76032779} - {fileID: 76032779}
- {fileID: 2050475644} - {fileID: 554720354}
- {fileID: 881809259} - {fileID: 881809259}
- {fileID: 2050475644}
m_Father: {fileID: 1666960088} m_Father: {fileID: 1666960088}
m_RootOrder: 6 m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -4686,7 +4683,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 2 value: 3
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_AnchorMax.x propertyPath: m_AnchorMax.x
@ -5115,7 +5112,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 0 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_AnchorMax.x propertyPath: m_AnchorMax.x

24
namedropper/Assets/Scenes/TopicSelect.unity

@ -273,7 +273,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 0 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_AnchorMax.x propertyPath: m_AnchorMax.x
@ -329,7 +329,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_AnchoredPosition.x propertyPath: m_AnchoredPosition.x
value: -615 value: -300
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
@ -476,10 +476,10 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1.0051374, y: 1.0051374, z: 1.0051374} m_LocalScale: {x: 1.0051374, y: 1.0051374, z: 1.0051374}
m_Children: m_Children:
- {fileID: 261236786}
- {fileID: 1272407094} - {fileID: 1272407094}
- {fileID: 1192266243} - {fileID: 261236786}
- {fileID: 1003872901} - {fileID: 1003872901}
- {fileID: 1192266243}
m_Father: {fileID: 1666960088} m_Father: {fileID: 1666960088}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -537,7 +537,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338377, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338377, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: _playerNumber propertyPath: _playerNumber
value: 4 value: 2
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338377, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338377, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: _spriteOptions.Array.size propertyPath: _spriteOptions.Array.size
@ -601,7 +601,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 3 value: 2
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_AnchorMax.x propertyPath: m_AnchorMax.x
@ -657,7 +657,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_AnchoredPosition.x propertyPath: m_AnchoredPosition.x
value: 624 value: 309
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
@ -807,7 +807,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 2 value: 3
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_AnchorMax.x propertyPath: m_AnchorMax.x
@ -863,7 +863,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_AnchoredPosition.x propertyPath: m_AnchoredPosition.x
value: 309.3 value: 624
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
@ -1102,7 +1102,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338377, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338377, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: _playerNumber propertyPath: _playerNumber
value: 2 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338377, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338377, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: _spriteOptions.Array.size propertyPath: _spriteOptions.Array.size
@ -1158,7 +1158,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_AnchorMax.x propertyPath: m_AnchorMax.x
@ -1214,7 +1214,7 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_AnchoredPosition.x propertyPath: m_AnchoredPosition.x
value: -300 value: -615
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3} - target: {fileID: 9049015333349338420, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y

29
namedropper/Assets/Scripts/Player.cs

@ -18,7 +18,7 @@ public class Player : MonoBehaviour
[SerializeField] List<TMPro.TMP_FontAsset> _shortFonts = new List<TMPro.TMP_FontAsset>(); [SerializeField] List<TMPro.TMP_FontAsset> _shortFonts = new List<TMPro.TMP_FontAsset>();
[SerializeField] bool _forTopicSelect = false; [SerializeField] bool _forTopicSelect = false;
Game _game; Game _game;
[SerializeField] int _playerNumber; public int _playerNumber;
bool _dropping = false; bool _dropping = false;
Vector3 _originalPosition; Vector3 _originalPosition;
int _streak = 0; int _streak = 0;
@ -56,7 +56,7 @@ public class Player : MonoBehaviour
if (GameManager.Instance.NumPlayers == 1) if (GameManager.Instance.NumPlayers == 1)
{ {
if (_playerNumber != 2) if (_playerNumber != 1)
{ {
gameObject.SetActive(false); gameObject.SetActive(false);
} }
@ -65,13 +65,13 @@ public class Player : MonoBehaviour
{ {
//player 1 remains on team 1 //player 1 remains on team 1
if (_playerNumber == 2 || _playerNumber == 4) if (_playerNumber == 1 || _playerNumber == 3)
{ {
gameObject.SetActive(false); gameObject.SetActive(false);
} }
if (_playerNumber == 3 && GameManager.Instance.Competitive) if (_playerNumber == 2 && GameManager.Instance.Competitive)
{ {
gameObject.layer = LayerMask.NameToLayer("Team 2"); gameObject.layer = LayerMask.NameToLayer("Team 2");
} }
@ -80,17 +80,17 @@ public class Player : MonoBehaviour
{ {
//player 1 remains on team 1 //player 1 remains on team 1
if (_playerNumber == 2) if (_playerNumber == 1)
{ {
gameObject.SetActive(false); gameObject.SetActive(false);
} }
if (_playerNumber == 3 && GameManager.Instance.Competitive) if (_playerNumber == 2 && GameManager.Instance.Competitive)
{ {
gameObject.layer = LayerMask.NameToLayer("Team 2"); gameObject.layer = LayerMask.NameToLayer("Team 2");
} }
if (_playerNumber == 4 && GameManager.Instance.Competitive) if (_playerNumber == 3 && GameManager.Instance.Competitive)
{ {
gameObject.layer = LayerMask.NameToLayer("Team 3"); gameObject.layer = LayerMask.NameToLayer("Team 3");
} }
@ -99,11 +99,11 @@ public class Player : MonoBehaviour
{ {
//player 1 & 2 remain on team 1 //player 1 & 2 remain on team 1
if (_playerNumber == 3) if (_playerNumber == 2)
{ {
gameObject.layer = LayerMask.NameToLayer("Team 2"); gameObject.layer = LayerMask.NameToLayer("Team 2");
} }
if (_playerNumber == 4) if (_playerNumber == 3)
{ {
gameObject.layer = LayerMask.NameToLayer("Team 2"); gameObject.layer = LayerMask.NameToLayer("Team 2");
} }
@ -180,6 +180,7 @@ public class Player : MonoBehaviour
private void OnTriggerEnter2D(Collider2D collision) private void OnTriggerEnter2D(Collider2D collision)
{ {
//category
Category category = collision.gameObject.GetComponent<Category>(); Category category = collision.gameObject.GetComponent<Category>();
if (category != null) if (category != null)
@ -204,8 +205,8 @@ public class Player : MonoBehaviour
} }
} }
//topic box
TopicBox topicBox = collision.gameObject.GetComponent<TopicBox>(); TopicBox topicBox = collision.gameObject.GetComponent<TopicBox>();
if (topicBox != null) if (topicBox != null)
{ {
if (TopicSelect.VOTE_ON_TOPIC) if (TopicSelect.VOTE_ON_TOPIC)
@ -219,6 +220,14 @@ public class Player : MonoBehaviour
SceneManager.LoadScene("Game"); SceneManager.LoadScene("Game");
} }
} }
//calibration box
CalibrationBox calibrationBox = collision.gameObject.GetComponent<CalibrationBox>();
if (calibrationBox != null)
{
calibrationBox.Calibrate(DeviceId);
this.gameObject.SetActive(false);
}
} }
// Update is called once per frame // Update is called once per frame

16
namedropper/Assets/Scripts/TopicSelect.cs

@ -61,34 +61,34 @@ public class TopicSelect : Level
{ {
worstScore = GameManager.Instance.Score1; worstScore = GameManager.Instance.Score1;
worstPlayerName = "light blue"; worstPlayerName = "light blue";
worstPlayerNumber = 1; worstPlayerNumber = 0;
} }
if (GameManager.Instance.Score2 < worstScore) if (GameManager.Instance.Score2 < worstScore)
{ {
worstScore = GameManager.Instance.Score2; worstScore = GameManager.Instance.Score2;
worstPlayerName = "dark blue"; worstPlayerName = "dark blue";
worstPlayerNumber = 2; worstPlayerNumber = 1;
} }
if (GameManager.Instance.Score3 < worstScore) if (GameManager.Instance.Score3 < worstScore)
{ {
worstScore = GameManager.Instance.Score3; worstScore = GameManager.Instance.Score3;
worstPlayerName = "dark red"; worstPlayerName = "dark red";
worstPlayerNumber = 3; worstPlayerNumber = 2;
} }
if (GameManager.Instance.Score4 < worstScore) if (GameManager.Instance.Score4 < worstScore)
{ {
worstScore = GameManager.Instance.Score4; worstScore = GameManager.Instance.Score4;
worstPlayerName = "light red"; worstPlayerName = "light red";
worstPlayerNumber = 4; worstPlayerNumber = 3;
} }
if (worstPlayerNumber != 1) if (worstPlayerNumber != 0)
GameObject.Destroy(_player1); GameObject.Destroy(_player1);
if (worstPlayerNumber != 2) if (worstPlayerNumber != 1)
GameObject.Destroy(_player2); GameObject.Destroy(_player2);
if (worstPlayerNumber != 3) if (worstPlayerNumber != 2)
GameObject.Destroy(_player3); GameObject.Destroy(_player3);
if (worstPlayerNumber != 4) if (worstPlayerNumber != 3)
GameObject.Destroy(_player4); GameObject.Destroy(_player4);
_subTitle.text = worstPlayerName + "\nmay pick the topic"; _subTitle.text = worstPlayerName + "\nmay pick the topic";

2
namedropper/Assets/Scripts/Wraparound.cs

@ -24,7 +24,7 @@ public class Wraparound : MonoBehaviour
} }
if (SceneManager.GetActiveScene().name == "TopicSelect") if (SceneManager.GetActiveScene().name == "TopicSelect" || SceneManager.GetActiveScene().name == "Calibration")
{ {
if (this.transform.position.x < 0) if (this.transform.position.x < 0)
{ {

32
namedropper/Assets/TrackballInputManager.cs

@ -28,7 +28,13 @@ public class TrackballInputManager : MonoBehaviour
List<int> _ignoredDevices = new List<int>(); List<int> _ignoredDevices = new List<int>();
[StructLayout(LayoutKind.Sequential)] static int[] Calibration = new int[4];
public static void Calibrate(int playerNumber, int DeviceId)
{
Calibration[playerNumber] = DeviceId;
}
public struct RawInputEvent public struct RawInputEvent
{ {
public int devHandle; public int devHandle;
@ -52,6 +58,7 @@ public class TrackballInputManager : MonoBehaviour
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
{ {
Debug.Log("starting trackballs");
//instance = this; //instance = this;
if (isInit == false) if (isInit == false)
{ {
@ -191,13 +198,18 @@ public class TrackballInputManager : MonoBehaviour
Debug.Log("Adding DeviceID " + deviceId); Debug.Log("Adding DeviceID " + deviceId);
int? playerNumberForCalibratedDevice = GetPlayerNumberForCalibratedDevice(deviceId);
foreach (Player p in _players) foreach (Player p in _players)
{ {
if (p.DeviceId == null) if (p.DeviceId == null)
{ {
p.DeviceId = deviceId; if (p._playerNumber == playerNumberForCalibratedDevice || playerNumberForCalibratedDevice == null)
_playersByDeviceId.Add(deviceId, p); {
return deviceId; p.DeviceId = deviceId;
_playersByDeviceId.Add(deviceId, p);
return deviceId;
}
} }
} }
@ -205,4 +217,16 @@ public class TrackballInputManager : MonoBehaviour
return -1; return -1;
} }
int? GetPlayerNumberForCalibratedDevice(int deviceId)
{
for (int i = 0; i < _players.Count; i++) {
if (Calibration[i] == deviceId)
{
return 0;
}
}
return null;
}
} }

3
namedropper/ProjectSettings/EditorBuildSettings.asset

@ -8,6 +8,9 @@ EditorBuildSettings:
- enabled: 1 - enabled: 1
path: Assets/Scenes/Title.unity path: Assets/Scenes/Title.unity
guid: 6ee247bbdb0f38647998cd2523f264c7 guid: 6ee247bbdb0f38647998cd2523f264c7
- enabled: 1
path: Assets/Scenes/Calibration.unity
guid: 1cdfc7379ea90c34e8ce5d94b5b43e30
- enabled: 1 - enabled: 1
path: Assets/Scenes/TopicSelect.unity path: Assets/Scenes/TopicSelect.unity
guid: a657dedad7b62af40a8121078bc5d04e guid: a657dedad7b62af40a8121078bc5d04e

7095
original art assets/plexi control panel.ai

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save