mirror of
https://github.com/FriendshipIsEpic/FiE-Game.git
synced 2024-11-27 07:47:59 +01:00
46 lines
1 KiB
C#
46 lines
1 KiB
C#
|
using Fie.Object;
|
||
|
using UnityEngine;
|
||
|
|
||
|
namespace Fie.Enemies.HoovesRaces.QueenChrysalis
|
||
|
{
|
||
|
[FiePrefabInfo("Prefabs/Enemies/ChangelingForces/QueenChrysalis/Power/QueenChrysalisMeteorBurst")]
|
||
|
public class FieEmitObjectQueenChrysalisMeteorShowerBurst : FieEmittableObjectBase
|
||
|
{
|
||
|
[SerializeField]
|
||
|
private float MeteorShowerBurstDuration = 0.7f;
|
||
|
|
||
|
[SerializeField]
|
||
|
private float MeteorShowerBurstDestroyDuration = 0.7f;
|
||
|
|
||
|
private bool _isEndUpdate;
|
||
|
|
||
|
private float _lifeCount;
|
||
|
|
||
|
public override void awakeEmitObject()
|
||
|
{
|
||
|
base.transform.rotation = Quaternion.LookRotation(directionalVec);
|
||
|
}
|
||
|
|
||
|
private void Update()
|
||
|
{
|
||
|
if (!_isEndUpdate)
|
||
|
{
|
||
|
_lifeCount += Time.deltaTime;
|
||
|
if (_lifeCount > MeteorShowerBurstDuration)
|
||
|
{
|
||
|
destoryEmitObject(MeteorShowerBurstDestroyDuration);
|
||
|
_isEndUpdate = true;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private void OnTriggerEnter(Collider collider)
|
||
|
{
|
||
|
if (!_isEndUpdate && collider.gameObject.tag == getHostileTagString())
|
||
|
{
|
||
|
addDamageToCollisionCharacter(collider, getDefaultDamageObject());
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|