Set Quaternion#
Set / Set Quaternion
Description#
Sets a Quaternion 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 Quaternion")]
[Image(typeof(IconQuaternion), ColorTheme.Type.Lime)]
[Description("Sets a Quaternion value")]
[Category("Set/Set Quaternion")]
[Parameter("Set", "Where the value is stored")]
[Parameter("Value", "The value to store")]
[Keywords("Set", "Change", "Modify", "Assign")]
[Keywords("Rotation", "Direction")]
[Serializable]
public class InstructionCoreSetQuaternion : Instruction
{
[SerializeField] private SetQuaternion m_Set = new SetQuaternion();
[SerializeField] private GetQuaternion m_Value = new GetQuaternion();
protected override string GetTitle(GameObject source) => $"{this.m_Set} = {this.m_Value}";
protected override Awaitable Run(Args args)
{
Quaternion value = this.m_Value.Get(args);
this.m_Set.Set(value, args);
return Done;
}
}
}