Rotation Constraint Source Count#
Animation / Constraints / Rotation Constraint / Rotation Constraint Source Count
Can Read
Cannot Write
Description#
The Source Count property of the Rotation 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("Rotation Constraint Source Count")]
[Category("Animation/Constraints/Rotation Constraint/Source Count")]
[Description("The Source Count property of the Rotation Constraint component")]
[Image(typeof(IconQuaternion), ColorTheme.Type.Pink)]
[Keywords("Direction, Euler, Transform")]
[Serializable]
public class GenTypeInteger_RotationConstraint_SourceCount : TypeNumber
{
[SerializeField] private GetGameObject m_RotationConstraint = new GetGameObject(
new GenTypeGameObject_RotationConstraint()
);
public override double GetPreview(GameObject source)
{
GameObject instance = this.m_RotationConstraint.GetPreview(source);
if (instance == null) return default;
RotationConstraint component = instance.GetComponent<RotationConstraint>();
return component != null ? component.sourceCount : default;
}
public override double Get(Args args)
{
RotationConstraint instance = this.m_RotationConstraint.Get<RotationConstraint>(args);
return instance != null
? instance.sourceCount
: default;
}
public override string ToString()
{
return $"{this.m_RotationConstraint} Source Count";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}