Browse Source

proper wheel colliding and scene loading

combinedRaceAndNameDropper
Josh 2 years ago
parent
commit
72a5d4a971
  1. 60
      namedropper/Assets/Scenes/Wheel Scene.unity
  2. 20
      namedropper/Assets/Scripts/ChallengingStage.cs
  3. 2
      namedropper/Assets/Scripts/Game.cs
  4. 2
      namedropper/Assets/Scripts/GameManager.cs
  5. 4
      namedropper/Assets/Scripts/Player.cs
  6. 793
      namedropper/Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Fallback.asset
  7. 33
      namedropper/Assets/_FortuneWheel/Scripts/FortuneWheel.cs

60
namedropper/Assets/Scenes/Wheel Scene.unity

@ -1687,6 +1687,18 @@ PrefabInstance:
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 68822329793193060, guid: e95f8a617163480449f527b1e40efc14, type: 3}
propertyPath: m_Offset.x
value: -0.01
objectReference: {fileID: 0}
- target: {fileID: 68822329793193060, guid: e95f8a617163480449f527b1e40efc14, type: 3}
propertyPath: m_Offset.y
value: -0.25
objectReference: {fileID: 0}
- target: {fileID: 68822329793193060, guid: e95f8a617163480449f527b1e40efc14, type: 3}
propertyPath: m_EdgeRadius
value: 0.81
objectReference: {fileID: 0}
- target: {fileID: 102960620597248174, guid: e95f8a617163480449f527b1e40efc14, type: 3}
propertyPath: m_Font
value:
@ -3541,6 +3553,18 @@ PrefabInstance:
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 68822329793193060, guid: e95f8a617163480449f527b1e40efc14, type: 3}
propertyPath: m_Offset.x
value: 0.4
objectReference: {fileID: 0}
- target: {fileID: 68822329793193060, guid: e95f8a617163480449f527b1e40efc14, type: 3}
propertyPath: m_Offset.y
value: -1.09
objectReference: {fileID: 0}
- target: {fileID: 68822329793193060, guid: e95f8a617163480449f527b1e40efc14, type: 3}
propertyPath: m_EdgeRadius
value: 2.09
objectReference: {fileID: 0}
- target: {fileID: 102960620597248174, guid: e95f8a617163480449f527b1e40efc14, type: 3}
propertyPath: m_Font
value:
@ -3970,6 +3994,18 @@ PrefabInstance:
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 68822329793193060, guid: e95f8a617163480449f527b1e40efc14, type: 3}
propertyPath: m_Offset.x
value: 0.35
objectReference: {fileID: 0}
- target: {fileID: 68822329793193060, guid: e95f8a617163480449f527b1e40efc14, type: 3}
propertyPath: m_Offset.y
value: -0.48
objectReference: {fileID: 0}
- target: {fileID: 68822329793193060, guid: e95f8a617163480449f527b1e40efc14, type: 3}
propertyPath: m_EdgeRadius
value: 1.28
objectReference: {fileID: 0}
- target: {fileID: 102960620597248174, guid: e95f8a617163480449f527b1e40efc14, type: 3}
propertyPath: m_Font
value:
@ -4271,6 +4307,18 @@ PrefabInstance:
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 68822329793193060, guid: e95f8a617163480449f527b1e40efc14, type: 3}
propertyPath: m_Offset.x
value: 0.02
objectReference: {fileID: 0}
- target: {fileID: 68822329793193060, guid: e95f8a617163480449f527b1e40efc14, type: 3}
propertyPath: m_Offset.y
value: -0.69
objectReference: {fileID: 0}
- target: {fileID: 68822329793193060, guid: e95f8a617163480449f527b1e40efc14, type: 3}
propertyPath: m_EdgeRadius
value: 1.69
objectReference: {fileID: 0}
- target: {fileID: 102960620597248174, guid: e95f8a617163480449f527b1e40efc14, type: 3}
propertyPath: m_Font
value:
@ -4436,6 +4484,18 @@ PrefabInstance:
propertyPath: m_Enabled
value: 1
objectReference: {fileID: 0}
- target: {fileID: 68822329793193060, guid: e95f8a617163480449f527b1e40efc14, type: 3}
propertyPath: m_Offset.x
value: 0.4
objectReference: {fileID: 0}
- target: {fileID: 68822329793193060, guid: e95f8a617163480449f527b1e40efc14, type: 3}
propertyPath: m_Offset.y
value: -1.1
objectReference: {fileID: 0}
- target: {fileID: 68822329793193060, guid: e95f8a617163480449f527b1e40efc14, type: 3}
propertyPath: m_EdgeRadius
value: 1.99
objectReference: {fileID: 0}
- target: {fileID: 102960620597248174, guid: e95f8a617163480449f527b1e40efc14, type: 3}
propertyPath: m_Font
value:

20
namedropper/Assets/Scripts/ChallengingStage.cs

@ -12,12 +12,12 @@ public class ChallengingStage : Level
[SerializeField] Canvas _canvas;
[SerializeField] GameObject _gummyPrefab;
int _seconds = 10;
int _seconds = 20;
int _originalFontSize;
// Start is called before the first frame update
void Start()
{
Timer.text = _seconds.ToString();
}
private void Awake()
@ -25,7 +25,6 @@ public class ChallengingStage : Level
base.Awake();
_originalFontSize = Timer.fontSize;
SpawnGummy();
StartCoroutine("StartupProcess");
}
@ -35,22 +34,27 @@ public class ChallengingStage : Level
Title.gameObject.SetActive(true);
Subtitle.gameObject.SetActive(false);
yield return new WaitForSeconds(1f);
Subtitle.gameObject.SetActive(true);
Title.text = "Eat the gummies!";
//Subtitle.gameObject.SetActive(true);
yield return new WaitForSeconds(2f);
Subtitle.gameObject.SetActive(false);
Title.gameObject.SetActive(true);
//Subtitle.gameObject.SetActive(false);
//Title.gameObject.SetActive(true);
Title.text = "GO!";
ActivatePlayers(true);
yield return new WaitForSeconds(1f);
Title.gameObject.SetActive(false);
Subtitle.gameObject.SetActive(false);
SpawnGummy();
StartCoroutine(Countdown());
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.F12))
{
SceneManager.LoadScene("TopicSelect");
}
}
IEnumerator Countdown()
{
@ -81,7 +85,7 @@ public class ChallengingStage : Level
powerup.transform.parent = _canvas.gameObject.transform;
powerup.transform.position = new Vector3(Random.Range(100f, 1920f-100f), Random.Range(100f, 1080f - 100f), powerup.transform.position.z);
Invoke("SpawnGummy", Random.Range(0, 2f - (_seconds * .1f)));
Invoke("SpawnGummy", Random.Range(0, 2f - (_seconds * .05f)));
}
}

2
namedropper/Assets/Scripts/Game.cs

@ -7,7 +7,7 @@ using UnityEngine.SceneManagement;
public class Game : Level
{
public const bool USE_MVP = true;
public const bool USE_UNLOCK = false;
public const bool USE_UNLOCK = true;
const bool HIDE_SCORES = true;
int _seconds = 70;

2
namedropper/Assets/Scripts/GameManager.cs

@ -31,7 +31,7 @@ public class GameManager
{
if (Round == 3)
{
return "Final round!";
return "Final round! 2x points";
}
else
{

4
namedropper/Assets/Scripts/Player.cs

@ -221,6 +221,10 @@ public class Player : MonoBehaviour
_streak++;
int streakBonus = category.ShowFeedbackGood(_streak);
int score = 10 + 10 * streakBonus;
if (GameManager.Instance.Round == 3)
score *= 2;
_game.AddScore(score, _playerNumber);
Respawn();

793
namedropper/Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF - Fallback.asset

File diff suppressed because one or more lines are too long

33
namedropper/Assets/_FortuneWheel/Scripts/FortuneWheel.cs

@ -3,6 +3,7 @@
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class FortuneWheel : MonoBehaviour
{
[Header("UI Properties")]
@ -19,7 +20,7 @@
public GameObject winParticles;
int _selectReward, _coins, count = 0, cost = 300;
string _sceneName = "";
string _gameName = "";
AudioSource[] audSource;
WheelPart[] wheelParts;
DotLight[] lightObjs;
@ -47,8 +48,8 @@
set
{
_selectReward = Mathf.Clamp(value, 0, FortuneWheelConfig.Instance.prizes.Length);
_sceneName = FortuneWheelConfig.Instance.prizes[_selectReward];
Debug.Log("Set scene name: " + _sceneName);
_gameName = FortuneWheelConfig.Instance.prizes[_selectReward];
Debug.Log("Set scene name: " + _gameName);
/*
if (spinning)
{
@ -133,6 +134,8 @@
yield return 0;
}
wheelToRotate.transform.eulerAngles = new Vector3(0.0f, 0.0f, maxAngle + startAngle);
yield return new WaitForSeconds(2.0f);
GivePrize();
//StartCoroutine(ShowHideParticles());
//StartCoroutine(IncrementCoroutine(coinsText, Coins + FortuneWheelConfig.Instance.prizes[SelectedReward], Coins));
@ -143,7 +146,29 @@
spinning = false;
spinButton.interactable = Coins >= cost;
//Coins += FortuneWheelConfig.Instance.prizes[SelectedReward];
SelectedReward = 0;
//SelectedReward = 0;
string sceneName = "";
if (_gameName == "Name Dropper")
{
sceneName = "RoundIntro";
}
else if (_gameName == "Indie 500")
{
sceneName = "RaceGame";
}
else if (_gameName == "Sumo")
{
sceneName = "Sumo";
}
else
{
Debug.LogError("unknown game name: " + _gameName);
}
SceneManager.LoadScene(sceneName);
}
IEnumerator ShowHideParticles()
{

Loading…
Cancel
Save