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