change
This commit is contained in:
@@ -13,6 +13,8 @@ public class BluePlayerController : MonoBehaviour
|
||||
private float cooldownTimer;
|
||||
|
||||
private bool isDead = false;
|
||||
public AudioSource audioSource;
|
||||
public AudioClip audioClip;
|
||||
|
||||
void Update()
|
||||
{
|
||||
@@ -46,6 +48,7 @@ public class BluePlayerController : MonoBehaviour
|
||||
Keyboard.current.gKey.wasPressedThisFrame &&
|
||||
cooldownTimer <= 0f)
|
||||
{
|
||||
AudioSource.PlayClipAtPoint(audioClip, firePoint.position);
|
||||
Instantiate(
|
||||
bulletPrefab,
|
||||
firePoint.position,
|
||||
|
||||
@@ -8,7 +8,8 @@ public class GameManager : MonoBehaviour
|
||||
|
||||
public GameObject resultPanel;
|
||||
public TextMeshProUGUI resultText;
|
||||
|
||||
public AudioSource audioSource;
|
||||
public AudioClip audioClip;
|
||||
private void Awake()
|
||||
{
|
||||
Instance = this;
|
||||
@@ -17,7 +18,7 @@ public class GameManager : MonoBehaviour
|
||||
public void ShowWinner(string loserName)
|
||||
{
|
||||
resultPanel.SetActive(true);
|
||||
|
||||
audioSource.PlayOneShot(audioClip);
|
||||
if (loserName.Contains("Blue"))
|
||||
resultText.text = "RED WIN!";
|
||||
else
|
||||
|
||||
@@ -13,6 +13,8 @@ public class RedPlayerController : MonoBehaviour
|
||||
private float cooldownTimer;
|
||||
|
||||
private bool isDead = false;
|
||||
public AudioSource audioSource;
|
||||
public AudioClip audioClip;
|
||||
|
||||
void Update()
|
||||
{
|
||||
@@ -44,6 +46,7 @@ public class RedPlayerController : MonoBehaviour
|
||||
Keyboard.current.jKey.wasPressedThisFrame &&
|
||||
cooldownTimer <= 0f)
|
||||
{
|
||||
AudioSource.PlayClipAtPoint(audioClip, firePoint.position);
|
||||
Instantiate(
|
||||
bulletPrefab,
|
||||
firePoint.position,
|
||||
|
||||
Reference in New Issue
Block a user