FiE-Game/Assets/Scripts/Fie/Ponies/Fie.Ponies.Applejack/FieEmitObjectApplejackYeehawFriendly.cs

47 lines
1 KiB
C#
Raw Normal View History

2018-11-20 20:10:49 +01:00
using Fie.Object;
using ParticlePlayground;
using UnityEngine;
namespace Fie.Ponies.Applejack
{
[FiePrefabInfo("Prefabs/Applejack/Power/ApplejackYeehawFriendly")]
public class FieEmitObjectApplejackYeehawFriendly : FieEmittableObjectBase
{
[SerializeField]
private float yeehawRegenDuration = 13f;
[SerializeField]
private float yeehawRegenEnableDuration = 10f;
[SerializeField]
private PlaygroundParticlesC particle;
private float _lifeTimeCount;
private bool _isEndUpdate;
public override void awakeEmitObject()
{
particle.emit = true;
base.ownerCharacter.damageSystem.AddDefenceMagni(-1, 0.25f, yeehawRegenEnableDuration);
}
public void Update()
{
if (initTransform != null)
{
base.transform.position = initTransform.position;
}
if (!_isEndUpdate)
{
_lifeTimeCount += Time.deltaTime;
if (_lifeTimeCount >= yeehawRegenEnableDuration)
{
_isEndUpdate = true;
destoryEmitObject(yeehawRegenDuration - yeehawRegenEnableDuration);
}
}
}
}
}