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:
commit
b0584dd46d
@ -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)) {
|
||||||
hitMarkerRect.anchoredPosition = WorldToUI(hit.point);
|
if (hit.transform.gameObject.layer != 7)
|
||||||
hitMarkerRect.gameObject.GetComponent<Image>().color = Color.green;
|
{
|
||||||
|
hitMarkerRect.anchoredPosition = WorldToUI(hit.point);
|
||||||
|
hitMarkerRect.gameObject.GetComponent<Image>().color = Color.green;
|
||||||
|
|
||||||
if(grappling){
|
if (grappling)
|
||||||
StartGrapple(hit);
|
{
|
||||||
}else{
|
StartGrapple(hit);
|
||||||
grappling = false;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user