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