Pull request #29: Cannot Grapple Spikes anymore

Merge in CEGJ/32bit_jam_conjure from GrappleStunFix to Dev

* commit '1c8c15c7efd5c539f6a903fae1f55324f50ffc1c':
  Cannot Grapple Spikes anymore
This commit is contained in:
Louis Horlaville 2022-10-30 21:29:03 +00:00 committed by Soulaha
commit b0584dd46d

View File

@ -91,15 +91,27 @@ public class GrappleHook : MonoBehaviour
if(!hitMarkerRect.gameObject.activeSelf)hitMarkerRect.gameObject.SetActive(true); if(!hitMarkerRect.gameObject.activeSelf)hitMarkerRect.gameObject.SetActive(true);
hitMarkerRect.anchoredPosition = WorldToUI(gameObject.transform.position + aimDir * maxGrappleDist); hitMarkerRect.anchoredPosition = WorldToUI(gameObject.transform.position + aimDir * maxGrappleDist);
if(Physics.Raycast(gameObject.transform.position, aimDir, out hit, maxGrappleDist, grappleableLayer)){ if (Physics.Raycast(gameObject.transform.position, aimDir, out hit, maxGrappleDist, grappleableLayer)) {
if (hit.transform.gameObject.layer != 7)
{
hitMarkerRect.anchoredPosition = WorldToUI(hit.point); hitMarkerRect.anchoredPosition = WorldToUI(hit.point);
hitMarkerRect.gameObject.GetComponent<Image>().color = Color.green; hitMarkerRect.gameObject.GetComponent<Image>().color = Color.green;
if(grappling){ if (grappling)
{
StartGrapple(hit); StartGrapple(hit);
}else{ }
else
{
grappling = false; grappling = false;
} }
}
else
{
hitMarkerRect.anchoredPosition = WorldToUI(hit.point);
hitMarkerRect.gameObject.GetComponent<Image>().color = Color.red;
}
}else{ }else{
hitMarkerRect.gameObject.GetComponent<Image>().color = Color.red; hitMarkerRect.gameObject.GetComponent<Image>().color = Color.red;
} }