Parent Constraint Remove Source#
Animation / Constraints / Parent Constraint / Parent Constraint Remove Source
Description#
Executes the Remove Source method on the Parent Constraint component
Parameters#
| Name | Description |
|---|---|
| Index |
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("Parent Constraint Remove Source")]
[Category("Animation/Constraints/Parent Constraint/Remove Source")]
[Description("Executes the Remove Source method on the Parent Constraint component")]
[Image(typeof(IconHanger), ColorTheme.Type.Pink)]
[Keywords("Socket, Ancestor, Keep, Track, Follow")]
[Parameter("Index")]
[Serializable]
public class GenInstructionParentConstraint_RemoveSource_1 : Instruction
{
[SerializeField] private GetGameObject m_ParentConstraint = new GetGameObject(
new GenTypeGameObject_ParentConstraint()
);
[SerializeField] private GetInteger m_Index = new GetInteger();
protected override string GetTitle(GameObject source)
{
string method = TextUtils.ThemeAsKeyword("Remove Source");
return $"{this.m_ParentConstraint} {method} ({this.m_Index})";
}
protected override Awaitable Run(Args args)
{
ParentConstraint component = this.m_ParentConstraint.Get<ParentConstraint>(args);
if (component == null) return Done;
component.RemoveSource(
(int) this.m_Index.Get(args)
);
return Done;
}
}
}