Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion GGJ26/Assets/00. Scenes/GameScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ GameObject:
- component: {fileID: 106689027}
- component: {fileID: 106689026}
- component: {fileID: 106689029}
- component: {fileID: 106689030}
m_Layer: 0
m_Name: Dead
m_TagString: Untagged
Expand Down Expand Up @@ -392,6 +393,36 @@ MonoBehaviour:
notDeadCanvas:
- {fileID: 1227170226}
- {fileID: 1227170227}
--- !u!114 &106689030
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 106689024}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c9b5e9a87a424d749c1d7f9f8e6a1b21, type: 3}
m_Name:
m_EditorClassIdentifier:
shoeSprite: {fileID: 21300000, guid: dfc97fc3e93a3fa43b8e5851f0ab29e4, type: 3}
smokeSprite: {fileID: 21300000, guid: 0be056719137a61479e5950dea34b7f4, type: 3}
danceSprite: {fileID: 21300000, guid: e7380c03ebdfd6948a716a5c06b4487b, type: 3}
keyOneSprite: {fileID: -1196241393, guid: 069a00c4a21d8654bbe27600f3ba7103, type: 3}
keyTwoSprite: {fileID: 13857534, guid: 069a00c4a21d8654bbe27600f3ba7103, type: 3}
keyThreeSprite: {fileID: -151394201, guid: 069a00c4a21d8654bbe27600f3ba7103, type: 3}
rootAnchoredPosition: {x: 0, y: 96}
iconSize: {x: 120, y: 120}
keySize: {x: 42, y: 56}
slotSpacing: 150
keyOffset: {x: 0, y: -12}
titleOffset: {x: 0, y: 150}
titleFontSize: 36
availableColor: {r: 1, g: 1, b: 1, a: 1}
usedColor: {r: 1, g: 1, b: 1, a: 0.28}
selectedOutlineColor: {r: 1, g: 0.3, b: 0.3, a: 1}
idleOutlineColor: {r: 0, g: 0, b: 0, a: 0}
outlineDistance: {x: 6, y: 6}
--- !u!1 &123334091
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -652,7 +683,6 @@ MonoBehaviour:
proximityMinDistance: 5
proximityMaxDistance: 30
voiceOutputMixerGroup: {fileID: 24300002, guid: d9084dee7259d2b43a99e89cd85b22c0, type: 2}
voiceSourceVolume: 1.7
--- !u!4 &148525648
Transform:
m_ObjectHideFlags: 0
Expand Down
2 changes: 1 addition & 1 deletion GGJ26/Assets/01. Scripts/Network/PlayerElimination.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ private void ApplyEliminatedState()
{
spectatorSabotageController.SetSpectatorAimOrigin(spectatorController.transform);
}
if (_playerRole != null && !_playerRole.IsSeeker)
if (_playerRole != null && _playerRole.IsSeeker == false)
{
var deadUI = FindFirstObjectByType<UIDead>();
if (deadUI != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ public class SpectatorSabotageController : NetworkBehaviour

[Header("Shoe Toss")]
[SerializeField] private Object shoeProjectilePrefab;
[SerializeField] private string shoeTemplateObjectName = "Shoe";
[SerializeField] private float shoeStunSeconds = 0.5f;
[SerializeField] private float shoeKnockbackSpeed = 2.4f;
[SerializeField] private float shoeProjectileSpeed = 18f;
[SerializeField] private float shoeProjectileSpeed = 24f;
[SerializeField] private float shoeProjectileLifetime = 1.2f;
[SerializeField] private float shoeProjectileGravity = 9.8f;
[SerializeField] private float shoeProjectileGravity = 4.2f;
[SerializeField] private float shoeSpawnForwardOffset = 0.8f;
[SerializeField] private float shoeHitRadius = 0.45f;
[SerializeField] private float shoeHitDistance = 22f;
[SerializeField] private Vector3 shoeSpinDegreesPerSecond = new Vector3(1080f, 540f, 720f);

[Header("Ghost Smoke")]
[SerializeField] private Object ghostSmokePrefab;
Expand Down Expand Up @@ -59,6 +61,7 @@ public class SpectatorSabotageController : NetworkBehaviour
private void Awake()
{
elimination = GetComponent<PlayerElimination>();
TryAutoAssignShoeProjectilePrefab();
TryAutoAssignGhostSmokePrefab();
ResolveCrosshairReferences();
}
Expand Down Expand Up @@ -452,7 +455,11 @@ private bool TryResolveShoeProjectilePrefab(out GameObject prefab)
prefab = null;
if (shoeProjectilePrefab == null)
{
return false;
TryAutoAssignShoeProjectilePrefab();
if (shoeProjectilePrefab == null)
{
return false;
}
}

if (shoeProjectilePrefab is GameObject asGameObject)
Expand All @@ -470,6 +477,27 @@ private bool TryResolveShoeProjectilePrefab(out GameObject prefab)
return false;
}

private void TryAutoAssignShoeProjectilePrefab()
{
if (string.IsNullOrWhiteSpace(shoeTemplateObjectName))
{
return;
}

var found = GameObject.Find(shoeTemplateObjectName);
if (found == null)
{
return;
}

shoeProjectilePrefab = found;

if (enableDebugLogs)
{
Debug.Log($"[Sabotage] Auto assigned shoe projectile template: {found.name}", this);
}
}

[Rpc(RpcSources.StateAuthority, RpcTargets.All)]
private void RpcPlayPhantomDance(NetworkId npcId, int danceIndex, float duration)
{
Expand Down Expand Up @@ -649,6 +677,7 @@ private IEnumerator MoveShoeProjectile(Transform projectile, Vector3 direction,
float remaining = Mathf.Max(0.05f, lifetime);
Vector3 velocity = (direction.sqrMagnitude > 0.0001f ? direction.normalized : Vector3.forward) * Mathf.Max(0.1f, speed);
float gravity = Mathf.Max(0f, shoeProjectileGravity);
Vector3 spin = shoeSpinDegreesPerSecond;
bool canApplyHit = Object != null && Object.HasStateAuthority;

while (projectile != null && remaining > 0f)
Expand All @@ -659,7 +688,8 @@ private IEnumerator MoveShoeProjectile(Transform projectile, Vector3 direction,
projectile.position += velocity * dt;
if (velocity.sqrMagnitude > 0.0001f)
{
projectile.rotation = Quaternion.LookRotation(velocity.normalized, Vector3.up);
Quaternion travelRotation = Quaternion.LookRotation(velocity.normalized, Vector3.up);
projectile.rotation = travelRotation * Quaternion.Euler(spin * (lifetime - remaining));
}

if (canApplyHit && TryApplyShoeHit(prevPos, projectile.position, velocity))
Expand Down
15 changes: 15 additions & 0 deletions GGJ26/Assets/01. Scripts/UI/GameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,21 @@ private void OnPlayerStateChanged(PlayerState updatedState)
Debug.Log($"[GameManager] Local player is known. Local ID: {localState.PlayerId}. Comparing with updated ID: {updatedState.PlayerId}.");
if (updatedState.PlayerId == localState.PlayerId)
{
if (updatedState.IsDead)
{
Debug.Log($"[GameManager] Local player death state received. IsSeeker={updatedState.IsSeeker}");
if (updatedState.IsSeeker == false)
{
var deadUI = FindFirstObjectByType<UIDead>();
if (deadUI != null)
{
deadUI.ShowDeadUI();
}
}

return;
}

if (uiCanvasManager != null)
{
Debug.Log($"[GameManager] Confirmed local player state change. Role is now Seeker = {updatedState.IsSeeker}. Updating UI.");
Expand Down
17 changes: 13 additions & 4 deletions GGJ26/Assets/01. Scripts/UI/UIDead.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.ComponentModel;
using UnityEngine;

public class UIDead : MonoBehaviour
Expand All @@ -9,7 +8,17 @@ public class UIDead : MonoBehaviour
public void ShowDeadUI()
{
Debug.Log("Showing Dead UI");
foreach (var c in notDeadCanvas) c.enabled = false;
CanvasDead.enabled = true;
foreach (var c in notDeadCanvas)
{
if (c != null)
{
c.enabled = false;
}
}

if (CanvasDead != null)
{
CanvasDead.enabled = true;
}
}
}
}
Loading