浏览代码

Removed the "Cache Result" option in StateConditionSOs

The option was causing more confusion than anything, and wasn't being used at all. Every condition has it on since it's the default, so I've left the feature active all the time while removing the toggle as discussed [here](https://forum.unity.com/threads/input-cached-when-not-immediately-consumed-by-a-state.1022698/#post-6786170).
/UI
DeivSky 3 年前
当前提交
6e0a7847
共有 2 个文件被更改,包括 0 次插入7 次删除
  1. 3
      UOP1_Project/Assets/Scripts/StateMachine/Core/StateCondition.cs
  2. 4
      UOP1_Project/Assets/Scripts/StateMachine/ScriptableObjects/StateConditionSO.cs

3
UOP1_Project/Assets/Scripts/StateMachine/Core/StateCondition.cs


/// </summary>
internal bool GetStatement()
{
if (!_originSO.cacheResult)
return Statement();
if (!_isCached)
{
_isCached = true;

4
UOP1_Project/Assets/Scripts/StateMachine/ScriptableObjects/StateConditionSO.cs


{
public abstract class StateConditionSO : ScriptableObject
{
[SerializeField]
[Tooltip("The condition will only be evaluated once each frame, and cached for subsequent uses.\r\n\r\nThe caching is unique to each instance of the State Machine and of the Scriptable Object (i.e. Instances of the State Machine or Condition don't share results if they belong to different GameObjects).")]
internal bool cacheResult = true;
/// <summary>
/// Will create a new custom <see cref="Condition"/> or use an existing one inside <paramref name="createdInstances"/>.
/// </summary>

正在加载...
取消
保存