Created
September 20, 2016 17:36
-
-
Save Drenerdo/d26fd3f8fa5c47e021ca7c5fb69038f3 to your computer and use it in GitHub Desktop.
PunchableBodyParts.cs
This file contains hidden or 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
using UnityEngine; | |
using System.Collections; | |
[RequireComponent(typeof(Collider))] | |
public class PunchableBodyParts : MonoBehaviour | |
{ | |
public EnemyController enemy; | |
void OnTriggerEnter(Collider col) | |
{ | |
Debug.Log(this.gameObject + " Collider works! " + col.gameObject.tag); | |
if (col.gameObject.tag != "Head") | |
{ | |
enemy.anim.SetBool("isHurt", true); | |
//enemy.GetComponent<>SetBool("isHurt", true); | |
} | |
if (col.gameObject.tag != "Spine") | |
{ | |
} | |
if (col.gameObject.tag != "Hips") | |
{ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment