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

50 lines
910 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/QueenChrysalisHitEffectBurned")]
public class FieEmitObjectQueenChrysalisHitEffectBurned : FieEmittableObjectBase
{
[SerializeField]
private PKFxFX _burningFx;
private const float DURATION = 1f;
private float _lifeCount;
private bool _isEnd;
public override void awakeEmitObject()
{
if (_burningFx != null)
{
_burningFx.StopEffect();
_burningFx.StartEffect();
}
}
private void Update()
{
if (!_isEnd)
{
_lifeCount += Time.deltaTime;
if (_lifeCount > 1f)
{
if (_burningFx != null)
{
_burningFx.StopEffect();
}
destoryEmitObject(1f);
_isEnd = true;
}
}
}
private void LateUpdate()
{
base.transform.position = initTransform.position;
}
}
}