Platform Effector 2D Rotational Offset#
Physics 2D / Effectors / Platform Effector 2D / Platform Effector 2D Rotational Offset
Description#
Compares the Rotational Offset property of Platform Effector 2D component to another value
Parameters#
| Name | Description |
|---|---|
| Platform Effector 2D | |
| Compare | |
| Value |
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("Platform Effector 2D Rotational Offset")]
[Category("Physics 2D/Effectors/Platform Effector 2D/Rotational Offset")]
[Description("Compares the Rotational Offset property of Platform Effector 2D component to another value")]
[Image(typeof(IconPlatformEffector), ColorTheme.Type.Lime, typeof(Badge2D))]
[Keywords("Physics, 2D")]
[Parameter("Platform Effector 2D")]
[Parameter("Compare")]
[Parameter("Value")]
[Serializable]
public class GenConditionNumber_PlatformEffector2D_CheckRotationalOffset : Condition
{
[SerializeField] private GetGameObject m_PlatformEffector2D = new GetGameObject(
new GenTypeGameObject_PlatformEffector2D()
);
[SerializeField] private CompareNumber m_Compare = new CompareNumber();
[SerializeField] private GetNumber m_Value = new GetNumber();
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Rotational Offset");
return $"{this.m_PlatformEffector2D} {member} {this.m_Compare} {this.m_Value}";
}
protected override bool Run(Args args)
{
PlatformEffector2D component = this.m_PlatformEffector2D.Get<PlatformEffector2D>(args);
if (component == null) return false;
return this.m_Compare.Compare(component.rotationalOffset, (float) this.m_Value.Get(args));
}
}
}