Set Parent Constraint Constraint Active#
Animation / Constraints / Parent Constraint / Set Parent Constraint Constraint Active
Description#
Sets the Constraint Active property of Parent Constraint component
Parameters#
| Name | Description |
|---|---|
| Parent Constraint | |
| 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;
using UnityEngine.Animations;
namespace VisualScript.Runtime
{
[Title("Set Parent Constraint Constraint Active")]
[Category("Animation/Constraints/Parent Constraint/Constraint Active")]
[Description("Sets the Constraint Active property of Parent Constraint component")]
[Image(typeof(IconHanger), ColorTheme.Type.Pink)]
[Keywords("Socket, Ancestor, Keep, Track, Follow")]
[Parameter("Parent Constraint")]
[Parameter("Value")]
[Serializable]
public class GenInstructionBool_ParentConstraint_SetConstraintActive : Instruction
{
[SerializeField] private GetGameObject m_ParentConstraint = new GetGameObject(
new GenTypeGameObject_ParentConstraint()
);
[SerializeField] private GetBool m_Value = new GetBool();
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Constraint Active");
return $"{this.m_ParentConstraint} {member} = {this.m_Value}";
}
protected override Awaitable Run(Args args)
{
ParentConstraint component = this.m_ParentConstraint.Get<ParentConstraint>(args);
if (component == null) return Done;
component.constraintActive = (bool) this.m_Value.Get(args);
return Done;
}
}
}