FiE-Game/Assets/Scripts/Fie/PlayMaker/FieFaderManagerForPlayMaker.cs

46 lines
772 B
C#
Raw Normal View History

2018-11-20 20:10:49 +01:00
using Fie.Manager;
using HutongGames.PlayMaker;
using UnityEngine;
namespace Fie.PlayMaker
{
[ActionCategory("Friendship is Epic")]
public class FieFaderManagerForPlayMaker : FsmStateAction
{
public FieFaderManager.FadeType fadeType;
public float fadeTime = 1f;
public float delay;
private float delayCount;
private bool isLaunched;
public override void Reset()
{
delayCount = 0f;
isLaunched = false;
}
public override void OnUpdate()
{
if (!isLaunched)
{
if (delayCount <= delay)
{
delayCount += Time.deltaTime;
}
else
{
if (delayCount >= delay && fadeType != 0)
{
FieManagerBehaviour<FieFaderManager>.I.LaunchFader(fadeType, fadeTime);
}
isLaunched = true;
}
}
}
}
}