Set String#
Set / Set String
Description#
Sets a String value
Parameters#
| Name | Description |
|---|---|
| Set | Where the value is stored |
| Value | The value to store |
Code#
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Title("Set String")]
[Image(typeof(IconString), ColorTheme.Type.Yellow)]
[Description("Sets a String value")]
[Category("Set/Set String")]
[Parameter("Set", "Where the value is stored")]
[Parameter("Value", "The value to store")]
[Keywords("Set", "Change", "Modify", "Assign")]
[Keywords("Text", "Char", "Characters", "Letter")]
[Serializable]
public class InstructionCoreSetString : Instruction
{
[SerializeField] private SetString m_Set = new SetString();
[SerializeField] private GetString m_Value = new GetString();
protected override string GetTitle(GameObject source) => $"{this.m_Set} = {this.m_Value}";
protected override Awaitable Run(Args args)
{
string value = this.m_Value.Get(args);
this.m_Set.Set(value, args);
return Done;
}
}
}