Skip to content

Commit

Permalink
Tweaks to cheezy
Browse files Browse the repository at this point in the history
  • Loading branch information
Frib authored and Frib committed Oct 2, 2023
1 parent 8e0fcd9 commit 0bd5836
Show file tree
Hide file tree
Showing 10 changed files with 388 additions and 10 deletions.
2 changes: 2 additions & 0 deletions UnityGame/Assets/MiniGames/1_Cheezy/1_Cheezy.unity
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,8 @@ MonoBehaviour:
- {fileID: 2100000, guid: 13d8f765a57aaff4b8e6e126454adb82, type: 2}
- {fileID: 2100000, guid: fad6833a8d774d644b1a3572839f573e, type: 2}
CooldownUI: {fileID: 82226256}
PlayerTagPrefab: {fileID: 5634148726937294452, guid: 1849ac1cae5cdf74db140b5bbbb3ac4e,
type: 3}
--- !u!1001 &827150058
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down
17 changes: 14 additions & 3 deletions UnityGame/Assets/MiniGames/1_Cheezy/MG1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class MG1 : MonoBehaviour
private Dictionary<int, bool> PlayerOnCooldown = new Dictionary<int, bool>();

public GameObject CooldownUI;
public GameObject PlayerTagPrefab;

private int playersFinished = 0;

Expand All @@ -38,6 +39,13 @@ void Start()
playerCount = MinigameManager.Instance.SignalR.Players.Count;

NewRound();
foreach (Transform child in allChildObjectStuff.transform)
{
var ptp = Instantiate(PlayerTagPrefab);
ptp.transform.position = /*child.position + (Vector3.up * 0) + */new Vector3(child.position.x, -4.25f, -.3f);
ptp.GetComponent<FloatingPlayerTag>().SetPlayer(MinigameManager.Instance.SignalR.Players.OrderBy(x => x.Value.PlayerIndex).ToList()[int.Parse(child.name)].Value);
}

}

public void StartGame()
Expand All @@ -55,10 +63,14 @@ void Update()
{
foreach (Transform player in allChildObjectStuff.transform)
{
var playerScore = playerCurRound[int.Parse(player.name)];
var playerIndex = int.Parse(player.name);
var playerScore = playerCurRound[playerIndex];
//Lerp local position using offset per cheese * playerScore
var lerpY = Mathf.Lerp(player.localPosition.y, (offsetYPerCheese * currentScale) * -playerScore, Time.deltaTime * 5f);
player.localPosition = new Vector3(player.localPosition.x, lerpY, player.localPosition.z);

if (player.childCount > 0)
player.GetChild(0).localEulerAngles = new Vector3(0, Mathf.Sin((Time.time + playerIndex) * 8) * 5, 0);
}
}

Expand Down Expand Up @@ -87,7 +99,7 @@ public IEnumerator CooldownPlayer(int player)
PlayerOnCooldown[player] = true;

var cdUI = GameObject.Instantiate(CooldownUI);
cdUI.transform.localPosition = new Vector3(gimmePos.positions[player], -2.5f, -gimmePos.scale - 0.01f);
cdUI.transform.localPosition = new Vector3(gimmePos.positions[player], -2.5f, -gimmePos.scale - 0.01f) + new Vector3(0, 0, -.15f);
var meshRender = cdUI.GetComponentInChildren<MeshRenderer>();

var madTexture = MinigameManager.Instance?.SignalR?.GetPlayerByNumber(player)?.PlayerMad?.texture;
Expand Down Expand Up @@ -194,7 +206,6 @@ public void NewRound()
playerCurRound.Add(0);
}


for (int y = 0; y < cheeseCountPerRound[currentRound]; y++)
{
var colorThisCheese = Random.Range(0, colorMaterials.Length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ Material:
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0, g: 0, b: 1, a: 1}
- _Color: {r: 0, g: 0, b: 1, a: 1}
- _BaseColor: {r: 0.42352945, g: 0.46274513, b: 0.7960785, a: 1}
- _Color: {r: 0.42352942, g: 0.46274507, b: 0.7960785, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ Material:
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 0, g: 1, b: 0, a: 1}
- _Color: {r: 0, g: 1, b: 0, a: 1}
- _BaseColor: {r: 0.49803925, g: 0.8313726, b: 0.25490198, a: 1}
- _Color: {r: 0.49803925, g: 0.8313726, b: 0.25490195, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ Material:
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 0, b: 0, a: 1}
- _Color: {r: 1, g: 0, b: 0, a: 1}
- _BaseColor: {r: 1, g: 0.20784315, b: 0.39607847, a: 1}
- _Color: {r: 1, g: 0.20784312, b: 0.39607844, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []
Expand Down
Loading

0 comments on commit 0bd5836

Please sign in to comment.