using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using BehaviorDesigner.Runtime;
using BehaviorDesigner.Runtime.Tasks;
using UnityEngine.SceneManagement;
using UnityGameFramework.Runtime;
///
/// 行为 受击
///
public class ActionBehit : Action
{
[BehaviorDesigner.Runtime.Tasks.Tooltip("等待时间")]
public SharedFloat waitTime = 1;
///
/// 开始时间
///
private float startTime;
///
/// 动画控制器
///
private Animator animator = null;
public override void OnAwake()
{
animator = gameObject.GetComponentInChildren();
}
public override void OnStart()
{
startTime = Time.time;
animator.SetBool("Hit", true);
}
public override TaskStatus OnUpdate()
{
if (startTime + waitTime.Value < Time.time)
{
return TaskStatus.Success;
}
return TaskStatus.Running;
}
}