using System;
namespace UnityEngine.Animations.Rigging
{
///
/// The [SyncSceneToStream] attribute can be used to ensure constraints properties are read from the scene
/// and written back in the AnimationStream if they were not previously animated.
/// Supported value types are: Float, Int, Bool, Vector2, Vector3, Vector4, Quaternion, Vector3Int, Vector3Bool,
/// Transform, Transform[], WeightedTransform and WeightedTransformArray.
///
[AttributeUsage(AttributeTargets.Field, Inherited = false, AllowMultiple = false)]
public sealed class SyncSceneToStreamAttribute : Attribute { }
internal enum PropertyType : byte { Bool, Int, Float };
internal struct PropertyDescriptor
{
public int size;
public PropertyType type;
}
internal struct Property
{
public string name;
public PropertyDescriptor descriptor;
}
internal struct RigProperties
{
public static string s_Weight = "m_Weight";
public Component component;
}
internal struct ConstraintProperties
{
public static string s_Weight = "m_Weight";
public Component component;
public Property[] properties;
}
///
/// Utility functions for constraints (deprecated).
///
[Obsolete("PropertyUtils is deprecated. Use ConstraintsUtils instead. (UnityUpgradable) -> ConstraintsUtils")]
public static class PropertyUtils
{
///
/// Prepends RigConstraint data property to specified property name.
///
/// Property name.
/// Return a complete property name.
[Obsolete("ConstructConstraintDataPropertyName is deprecated. Use ConstraintsUtils.ConstructConstraintDataPropertyName instead.")]
public static string ConstructConstraintDataPropertyName(string property)
{
return ConstraintsUtils.ConstructConstraintDataPropertyName(property);
}
///
/// Builds a unique property name for a custom property.
///
/// Associated component.
/// Property name.
/// Returns a custom property name.
[Obsolete("ConstructCustomPropertyName is deprecated. Use ConstraintsUtils.ConstructCustomPropertyName instead.")]
public static string ConstructCustomPropertyName(Component component, string property)
{
return ConstraintsUtils.ConstructCustomPropertyName(component, property);
}
}
}