-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1a03063
commit 16d85c7
Showing
11 changed files
with
645 additions
and
340 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class Ammo : MonoBehaviour | ||
{ | ||
private void OnTriggerEnter(Collider other) | ||
{ | ||
PlayerAmmo playerAmmo = other.GetComponent<PlayerAmmo>(); | ||
|
||
if (playerAmmo != null) | ||
{ | ||
playerAmmo.AmmoCollected(); | ||
gameObject.SetActive(false); | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
.../Scripts/Weapons/WeaponController.cs.meta → Assets/Scripts/Controller/Ammo.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using TMPro; | ||
|
||
|
||
public class AmmoUI : MonoBehaviour | ||
{ | ||
private TextMeshProUGUI ammoText; | ||
|
||
// Start is called before the first frame update | ||
void Start() | ||
{ | ||
ammoText = GetComponent<TextMeshProUGUI>(); | ||
} | ||
|
||
public void UpdateKeyText(PlayerAmmo playerAmmo) | ||
{ | ||
ammoText.text = playerAmmo.NumberOfAmmos.ToString(); | ||
} | ||
|
||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.Events; | ||
|
||
public class PlayerAmmo : MonoBehaviour | ||
{ | ||
public int NumberOfAmmos { get; private set; } | ||
|
||
public UnityEvent<PlayerAmmo> OnAmmoCollected; | ||
|
||
|
||
public void AmmoCollected() | ||
{ | ||
NumberOfAmmos++; | ||
OnAmmoCollected.Invoke(this); | ||
} | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ TagManager: | |
- enemy | ||
- target | ||
- Goal | ||
- CinemachineTarget | ||
- bullet | ||
layers: | ||
- Default | ||
- TransparentFX | ||
|