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