架构大更
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
using SLSFramework.General;
|
||||
using UnityEngine;
|
||||
|
||||
namespace SLSFramework.General
|
||||
{
|
||||
/// <summary>在 outerContext 中设置一个键值对。</summary>
|
||||
public class Cmd_SetVariable : CommandBase
|
||||
{
|
||||
private readonly string variableName;
|
||||
private readonly object value;
|
||||
|
||||
public Cmd_SetVariable(string variableName, object value)
|
||||
{
|
||||
this.variableName = variableName;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
protected override UniTask ExecuteAsync(CommandContext outerContext)
|
||||
{
|
||||
Debug.Log($"[Cmd_SetVariable] 设置变量 '{variableName}',值为: '{value}'");
|
||||
outerContext.context[variableName] = value;
|
||||
return UniTask.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user