Transform Rotate#
Transform / Rotation / Transform Rotate Axis, Angle, RelativeTo
Description#
Changes the rotation of the transform in multiple ways
Parameters#
| Name | Description |
|---|---|
| Axis | |
| Angle | |
| Relative To |
Code#
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Title("Transform Rotate")]
[Category("Transform/Rotation/Rotate", "Axis, Angle, RelativeTo")]
[Description("Changes the rotation of the transform in multiple ways")]
[Image(typeof(IconRotation), ColorTheme.Type.Lime)]
[Keywords("Transform")]
[Parameter("Axis")]
[Parameter("Angle")]
[Parameter("Relative To")]
[Serializable]
public class GenInstructionTransform_Rotate_3_Vector3Axis_FloatAngle_SpaceRelativeTo : Instruction
{
[SerializeField] private GetGameObject m_Transform = new GetGameObject(
new GenTypeGameObject_Transform()
);
[SerializeField] private GetVector3 m_Axis = new GetVector3();
[SerializeField] private GetNumber m_Angle = new GetNumber();
[SerializeField] private Space m_RelativeTo = default;
protected override string GetTitle(GameObject source)
{
string method = TextUtils.ThemeAsKeyword("Rotate");
return $"{this.m_Transform} {method} ({this.m_Axis}, {this.m_Angle}, {this.m_RelativeTo})";
}
protected override Awaitable Run(Args args)
{
Transform component = this.m_Transform.Get<Transform>(args);
if (component == null) return Done;
component.Rotate(
(Vector3) this.m_Axis.Get(args),
(float) this.m_Angle.Get(args),
this.m_RelativeTo
);
return Done;
}
}
}