Added base Round Logic and base map with characters
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
using Unity.Netcode;
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
using Unity.Collections;
|
||||
|
||||
public class PlayerController : NetworkBehaviour
|
||||
{
|
||||
[SerializeField] private float moveSpeed = 5f;
|
||||
|
||||
[SerializeField] private Camera playerCamera;
|
||||
[SerializeField] private Camera playerHandCamera;
|
||||
[SerializeField] private GameObject tpvHands;
|
||||
[SerializeField] private GameObject fpvHands;
|
||||
|
||||
|
||||
[SerializeField] private float mouseSensitivity = 2f;
|
||||
[SerializeField] private Transform cameraRoot;
|
||||
@@ -19,7 +21,10 @@ public class PlayerController : NetworkBehaviour
|
||||
if (playerCamera != null)
|
||||
{
|
||||
playerCamera.enabled = IsOwner;
|
||||
playerHandCamera.enabled = IsOwner;
|
||||
playerCamera.GetComponent<AudioListener>().enabled = IsOwner;
|
||||
fpvHands.SetActive(IsOwner);
|
||||
tpvHands.SetActive(!IsOwner);
|
||||
}
|
||||
|
||||
if (IsOwner)
|
||||
@@ -28,19 +33,16 @@ public class PlayerController : NetworkBehaviour
|
||||
Cursor.visible = false;
|
||||
}
|
||||
|
||||
if (IsOwner)
|
||||
Color playerColor = IsOwner ? Color.blue : Color.red;
|
||||
foreach (MeshRenderer meshRenderer in GetComponentsInChildren<MeshRenderer>())
|
||||
{
|
||||
GetComponent<Renderer>().material.color = Color.blue;
|
||||
}
|
||||
else
|
||||
{
|
||||
GetComponent<Renderer>().material.color = Color.red;
|
||||
meshRenderer.material.color = playerColor;
|
||||
}
|
||||
|
||||
if (IsOwner)
|
||||
{
|
||||
transform.position = new Vector3(Random.Range(-10f, 10f), 1f, Random.Range(-10f, 10f));
|
||||
}
|
||||
// if (IsOwner)
|
||||
// {
|
||||
// transform.position = new Vector3(Random.Range(-10f, 10f), 1f, Random.Range(-10f, 10f));
|
||||
// }
|
||||
}
|
||||
|
||||
public void Update()
|
||||
|
||||
Reference in New Issue
Block a user