Fixed warning panel

dev-main
Hazim Bin Ijaz 1 day ago
parent 7d9fb0ce4c
commit f3cc730e71

@ -22,4 +22,4 @@ MonoBehaviour:
prefab: {fileID: 2026889198986879358, guid: cbe217685dd069b47ac56eefeb3f6cdc, type: 3}
travelTime: 3
spawnRadius: 30
warningTime: 3
warningTime: 5

@ -600,7 +600,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5109095020609682098, guid: d3e4ffd5da62ee94e9eccf3ab52ec129, type: 3}
propertyPath: GlobalObjectIdHash
value: 3937158934
value: 2459418115
objectReference: {fileID: 0}
- target: {fileID: 5935320730402577130, guid: d3e4ffd5da62ee94e9eccf3ab52ec129, type: 3}
propertyPath: m_Name
@ -608,7 +608,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5935320730402577130, guid: d3e4ffd5da62ee94e9eccf3ab52ec129, type: 3}
propertyPath: m_IsActive
value: 0
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
@ -782,7 +782,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4600110157238723790, guid: 0d2d836e2e83b754fa1a1c4022d6d65d, type: 3}
propertyPath: GlobalObjectIdHash
value: 3737985212
value: 2714313788
objectReference: {fileID: 0}
- target: {fileID: 4600110157238723790, guid: 0d2d836e2e83b754fa1a1c4022d6d65d, type: 3}
propertyPath: PrefabHashGenerator

@ -2,6 +2,7 @@ using UnityEngine;
using Unity.Netcode;
using Unity.BossRoom.Gameplay.GameplayObjects.Character;
using System.Collections;
using System.Linq;
using Unity.BossRoom.Gameplay.GameplayObjects;
public class ExecutionerBox : NetworkBehaviour
@ -23,6 +24,7 @@ public class ExecutionerBox : NetworkBehaviour
var abilitySystem = serverCharacter.GetComponent<AbilitySystem>();
if (abilitySystem != null)
{
WarningPanel.Instance.ShowPanel(2f);
abilitySystem.InitiateGlobalCooldown(GameDataSource.Instance.TheExecutionerKey);
}
break; // Exit loop after finding the local player
@ -46,9 +48,6 @@ public class ExecutionerBox : NetworkBehaviour
private IEnumerator StartExecutionerSequence()
{
// Show warning UI on all clients
// UIManager.Instance.ShowExecutionerWarning(_warningTime);
WarningPanel.Instance.ShowPanelForTime(_warningTime);
// Wait for the warning time before moving
yield return new WaitForSeconds(_warningTime);

@ -568,6 +568,7 @@ namespace Unity.BossRoom.Gameplay.GameplayObjects.Character
public override void OnNetworkSpawn()
{
CrowManager.Instance.OnPlayerSpawned(this);
crowModel.SetActive(false);
if (!IsServer) { enabled = false; }
else
{
@ -588,7 +589,8 @@ namespace Unity.BossRoom.Gameplay.GameplayObjects.Character
InitializeHitPoints();
}
}
public override void OnNetworkDespawn()
{
CrowManager.Instance.OnPlayerDespawned(this);

@ -20,17 +20,7 @@ public class WarningPanel : NetworkBehaviour
Destroy(gameObject);
}
}
public void ShowPanelForTime(float seconds)
{
if (IsServer) // Only the server should trigger this
{
ShowPanelClientRpc(seconds);
}
}
[ClientRpc]
private void ShowPanelClientRpc(float seconds)
public void ShowPanel(float seconds)
{
panel.SetActive(true);
StartCoroutine(HidePanelAfterTime(seconds));

Loading…
Cancel
Save