Add guiding coins

Remove grapple charges
This commit is contained in:
Soulaha Balde 2022-10-29 22:30:08 -04:00
parent ba4ef9f55f
commit f29d349fde
5 changed files with 6023 additions and 15 deletions

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 53056f94da94bf547aa8c99f5ddc65c3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b21d108029ebabd49b8c106e7d982efb
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -18,14 +18,18 @@ public class Collectible : MonoBehaviour
private void OnTriggerEnter(Collider other) {
if(other.gameObject.tag.Equals("Player")){
other.gameObject.GetComponent<GrappleHook>().AddCharge(amount);
Vanish();
}
}
private void Vanish(){
gameObject.SetActive(false);
if(timeToAppear > -1){
Invoke("Appear", timeToAppear);
}else{
Destroy(this.gameObject);
}
}
private void Appear(){

View File

@ -26,8 +26,6 @@ public class GrappleHook : MonoBehaviour
private LayerMask grappleableLayer;
[SerializeField]
private float aimSpeed = 50f;
[SerializeField]
private int charges = 5;
[Header("References")]
[SerializeField]
@ -95,12 +93,7 @@ public class GrappleHook : MonoBehaviour
if(Physics.Raycast(gameObject.transform.position, aimDir, out hit, maxGrappleDist, grappleableLayer)){
hitMarkerRect.anchoredPosition = WorldToUI(hit.point);
if(charges > 0){
hitMarkerRect.gameObject.GetComponent<Image>().color = Color.green;
}else{
hitMarkerRect.gameObject.GetComponent<Image>().color = Color.red;
}
if(grappling){
StartGrapple(hit);
@ -131,7 +124,6 @@ public class GrappleHook : MonoBehaviour
}
private void StartGrapple(RaycastHit hit){
grappling = false;
if(charges <= 0)return;
grappled = true;
soundPlayer.PlaySound("PlayerGrappleHit");
@ -163,7 +155,6 @@ public class GrappleHook : MonoBehaviour
}
hookedTo = hit.transform.gameObject;
currGrappleEndPos = transform.position;
charges--;
}
private void EndGrapple(){
@ -210,9 +201,6 @@ public void Unhook(GameObject hookedObj){
EndGrapple();
}
public void AddCharge(int amount){
charges += amount;
}
#endregion
#region InputActions