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