Added base Round Logic and base map with characters
This commit is contained in:
@@ -9,9 +9,25 @@ public class PlayerShoot : NetworkBehaviour
|
||||
|
||||
[SerializeField] GameObject hitEffectPrefab;
|
||||
|
||||
private PlayerHealth playerHealth;
|
||||
|
||||
public override void OnNetworkSpawn()
|
||||
{
|
||||
if (IsOwner)
|
||||
{
|
||||
playerHealth = GetComponent<PlayerHealth>();
|
||||
if (playerHealth == null)
|
||||
{
|
||||
Debug.LogError("PlayerHealth component not found on player");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (!IsOwner) return;
|
||||
|
||||
if(playerHealth == null || playerHealth.isDead.Value) return;
|
||||
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
@@ -44,6 +60,6 @@ public class PlayerShoot : NetworkBehaviour
|
||||
private void SpawnHitEffectClientRpc(Vector3 _hitPosition)
|
||||
{
|
||||
Debug.Log($"Spawning hit effect at {_hitPosition}");
|
||||
NetworkBehaviour.Instantiate(hitEffectPrefab, _hitPosition, Quaternion.identity);
|
||||
Instantiate(hitEffectPrefab, _hitPosition, Quaternion.identity);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user