Firstborn/Assets/RPG Creation Kit/Scripts/Combat System/_General/BlockingZone.cs
Schaken-Mods 959e80cf72 assets upload
assets upload description.
2023-03-28 12:16:30 -05:00

34 lines
910 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using RPGCreationKit;
using RPGCreationKit.Player;
namespace RPGCreationKit
{
/// <summary>
/// Defines a BlockingZone. Each of instance of this script is directly connected to a 'CombatSystem' component.
/// </summary>
public class BlockingZone : MonoBehaviour, IHittable
{
[SerializeField] bool isPlayer = false;
public AI.AICombatSystem aiCombat;
public void GenerateDecal()
{
}
public void Hit(Vector3 hitDir, float forceAmount = 25, DamageContext damageContext = null)
{
if(isPlayer)
{
RckPlayer.instance.GetComponent<IDamageable>().DamageBlocked(damageContext);
}
else
{
aiCombat.DamageBlocked(damageContext);
}
}
}
}