Look At Constraint Roll#
Animation / Constraints / Look At Constraint / Look At Constraint Roll
Can Read
Can Write
Description#
The Roll property of the Look At Constraint component
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;
using UnityEngine.Animations;
namespace VisualScript.Runtime
{
[Get]
[Set]
[Title("Look At Constraint Roll")]
[Category("Animation/Constraints/Look At Constraint/Roll")]
[Description("The Roll property of the Look At Constraint component")]
[Image(typeof(IconBullsEye), ColorTheme.Type.Pink)]
[Keywords("Track, Follow")]
[Serializable]
public class GenTypeNumber_LookAtConstraint_Roll : TypeNumber
{
[SerializeField] private GetGameObject m_LookAtConstraint = new GetGameObject(
new GenTypeGameObject_LookAtConstraint()
);
public override double GetPreview(GameObject source)
{
GameObject instance = this.m_LookAtConstraint.GetPreview(source);
if (instance == null) return default;
LookAtConstraint component = instance.GetComponent<LookAtConstraint>();
return component != null ? component.roll : default;
}
public override double Get(Args args)
{
LookAtConstraint instance = this.m_LookAtConstraint.Get<LookAtConstraint>(args);
return instance != null
? instance.roll
: default;
}
public override void Set(double value, Args args)
{
LookAtConstraint component = this.m_LookAtConstraint.Get<LookAtConstraint>(args);
if (component != null) component.roll = (float) value;
}
public override string ToString()
{
return $"{this.m_LookAtConstraint} Roll";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}