BITFALL/Assets/AmplifyAnimationPack/Scripts/Interactables/EnemyClass.cs

31 lines
651 B
C#
Raw Normal View History

2024-04-15 14:57:50 +08:00
// Amplify Animation Pack - Third-Person Character Controller
// Copyright (c) Amplify Creations, Lda <info@amplify.pt>
using UnityEngine;
namespace AmplifyAnimationPack
{
public class EnemyClass : MonoBehaviour
{
[SerializeField]
private GameObject destructionFXPrefab;
private void OnTriggerEnter( Collider other )
{
if( other.name == "Hitbox" )
{
Instantiate( destructionFXPrefab , transform.position , Quaternion.identity );
CharacterClass charRef = other.GetComponentInParent<CharacterClass>();
if( charRef.isLocked )
{
charRef.TriggerLockOn();
}
gameObject.SetActive( false );
}
}
}
}