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