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