FiE-Game/Assets/Scripts/Fie/Enemies/HoovesRaces/QueenChrysalis/FieEmitObjectQueenChrysalisAirRaidPreHit.cs

36 lines
831 B
C#
Raw Normal View History

2018-11-20 20:10:49 +01:00
using Fie.Object;
using UnityEngine;
namespace Fie.Enemies.HoovesRaces.QueenChrysalis
{
[FiePrefabInfo("Prefabs/Enemies/ChangelingForces/QueenChrysalis/Power/QueenChrysalisAirRaidPreEffect")]
public class FieEmitObjectQueenChrysalisAirRaidPreHit : FieEmittableObjectBase
{
private const float DURATION = 2f;
[SerializeField]
private float _damageDuration = 0.3f;
private float _lifeCount;
public override void awakeEmitObject()
{
base.transform.rotation = Quaternion.identity;
destoryEmitObject(2f);
}
private void Update()
{
_lifeCount += Time.deltaTime;
}
private void OnTriggerEnter(Collider collider)
{
if (!(_lifeCount > _damageDuration) && collider.gameObject.tag == getHostileTagString())
{
addDamageToCollisionCharacter(collider, getDefaultDamageObject());
}
}
}
}