Transform Rotate Around#
Transform / Rotation / Transform Rotate Around Point, Axis, Angle
Description#
Rotates the transform around some axis in world coordinates
Parameters#
| Name | Description |
|---|---|
| Point | |
| Axis | |
| Angle |
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 Around")]
[Category("Transform/Rotation/Rotate Around", "Point, Axis, Angle")]
[Description("Rotates the transform around some axis in world coordinates")]
[Image(typeof(IconRotationYaw), ColorTheme.Type.Lime)]
[Keywords("Transform")]
[Parameter("Point")]
[Parameter("Axis")]
[Parameter("Angle")]
[Serializable]
public class GenInstructionTransform_RotateAround_3_Vector3Point_Vector3Axis_FloatAngle : Instruction
{
[SerializeField] private GetGameObject m_Transform = new GetGameObject(
new GenTypeGameObject_Transform()
);
[SerializeField] private GetVector3 m_Point = new GetVector3();
[SerializeField] private GetVector3 m_Axis = new GetVector3();
[SerializeField] private GetNumber m_Angle = new GetNumber();
protected override string GetTitle(GameObject source)
{
string method = TextUtils.ThemeAsKeyword("Rotate Around");
return $"{this.m_Transform} {method} ({this.m_Point}, {this.m_Axis}, {this.m_Angle})";
}
protected override Awaitable Run(Args args)
{
Transform component = this.m_Transform.Get<Transform>(args);
if (component == null) return Done;
component.RotateAround(
(Vector3) this.m_Point.Get(args),
(Vector3) this.m_Axis.Get(args),
(float) this.m_Angle.Get(args)
);
return Done;
}
}
}