Files
Cielonos/Packages/dev.yarnspinner.unity/Runtime/Commands/CommandDispatchResult.cs
SoulliesOfficial 8186f54e90 新场景,剧情
2026-06-02 12:55:39 -04:00

65 lines
1.4 KiB
C#

/*
Yarn Spinner is licensed to you under the terms found in the file LICENSE.md.
*/
using System;
#nullable enable
namespace Yarn.Unity
{
/// <summary>
/// Represents the result of attempting to locate and call a command.
/// </summary>
/// <seealso cref="DispatchCommandToGameObject(Command, Action)"/>
/// <seealso cref="DispatchCommandToRegisteredHandlers(Command, Action)"/>
internal struct CommandDispatchResult
{
internal enum ParameterParseStatusType
{
Succeeded,
InvalidParameterType,
InvalidParameterCount,
}
internal enum StatusType
{
Succeeded,
NoTargetFound,
TargetMissingComponent,
InvalidParameterCount,
InvalidParameter,
/// <summary>
/// The command could not be found.
/// </summary>
CommandUnknown,
};
internal StatusType Status;
internal string? Message;
internal YarnTask Task;
public CommandDispatchResult(StatusType status)
{
Status = status;
Task = YarnTask.CompletedTask;
Message = null;
}
public CommandDispatchResult(StatusType status, YarnTask task)
{
Status = status;
Task = task;
Message = null;
}
}
}