unity-atoms/Packages/FSM/Runtime/FiniteStateMachine/FSMState.cs

27 lines
733 B
C#
Raw Normal View History

2020-03-09 18:51:14 -04:00
using System;
using UnityEngine;
using UnityAtoms.BaseAtoms;
namespace UnityAtoms.FSM
{
2020-03-21 17:45:39 -04:00
/// <summary>
/// Class representing a state in the FSM.
/// </summary>
2020-03-09 18:51:14 -04:00
[Serializable]
2020-03-11 16:11:27 -04:00
public class FSMState
2020-03-09 18:51:14 -04:00
{
public string Id { get => _id.Value; }
public FiniteStateMachine SubMachine { get => _subMachine; }
public float Timer { get; set; }
2020-03-11 16:11:27 -04:00
public float Cooldown { get => _cooldown.Value; }
2020-03-09 18:51:14 -04:00
[SerializeField]
2020-03-11 16:11:27 -04:00
private StringReference _id = default(StringReference);
2020-03-09 18:51:14 -04:00
[SerializeField]
2020-03-11 16:11:27 -04:00
private FloatReference _cooldown = new FloatReference(0f);
2020-03-09 18:51:14 -04:00
[SerializeField]
2020-03-11 16:11:27 -04:00
private FiniteStateMachine _subMachine = default(FiniteStateMachine);
2020-03-09 18:51:14 -04:00
}
}