30 lines
708 B
C#
30 lines
708 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class PlayerController : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
private LayerMask stunLayerMask;
|
|
private GrappleHook grappleScript;
|
|
[SerializeField]
|
|
private float stunDuration;
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
grappleScript = GetComponent<GrappleHook>();
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
|
|
private void OnCollisionEnter(Collision other) {
|
|
if(((1<<other.gameObject.layer) & stunLayerMask) != 0){//Collided w/ somtehing that stuns
|
|
grappleScript.Stun(stunDuration);
|
|
}
|
|
}
|
|
}
|