continuing with combat, sword combos working, not finished, blockign working, need to build blockpush and improving bow combat
This commit is contained in:
61
Assets/Scripts/AnimationEventRelay.cs
Normal file
61
Assets/Scripts/AnimationEventRelay.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// Attach this script directly to the child GameObject that has the Animator component (e.g., "Model").
|
||||
/// It will catch Animation Events triggered by the animations and forward them up to the parent GameObject
|
||||
/// where your actual combat scripts (like MeleeCombatLayerController) are sitting!
|
||||
/// </summary>
|
||||
public class AnimationEventRelay : MonoBehaviour
|
||||
{
|
||||
// ==========================================
|
||||
// MELEE EVENTS
|
||||
// ==========================================
|
||||
|
||||
public void DealDamage()
|
||||
{
|
||||
if (transform.parent != null)
|
||||
{
|
||||
transform.parent.SendMessageUpwards("DealDamage", SendMessageOptions.DontRequireReceiver);
|
||||
}
|
||||
}
|
||||
|
||||
public void Hit()
|
||||
{
|
||||
if (transform.parent != null)
|
||||
{
|
||||
transform.parent.SendMessageUpwards("Hit", SendMessageOptions.DontRequireReceiver);
|
||||
}
|
||||
}
|
||||
|
||||
public void loadArrow()
|
||||
{
|
||||
if (transform.parent != null)
|
||||
{
|
||||
transform.parent.SendMessageUpwards("loadArrow", SendMessageOptions.DontRequireReceiver);
|
||||
}
|
||||
}
|
||||
|
||||
public void Fire()
|
||||
{
|
||||
if (transform.parent != null)
|
||||
{
|
||||
transform.parent.SendMessageUpwards("Fire", SendMessageOptions.DontRequireReceiver);
|
||||
}
|
||||
}
|
||||
|
||||
public void FootR()
|
||||
{
|
||||
if (transform.parent != null)
|
||||
{
|
||||
transform.parent.SendMessageUpwards("FootR", SendMessageOptions.DontRequireReceiver);
|
||||
}
|
||||
}
|
||||
|
||||
public void FootL()
|
||||
{
|
||||
if (transform.parent != null)
|
||||
{
|
||||
transform.parent.SendMessageUpwards("FootL", SendMessageOptions.DontRequireReceiver);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user