Constraint.cs 854 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using UnityEngine;
  2. using System.Collections;
  3. namespace RootMotion.FinalIK {
  4. /// <summary>
  5. /// The base abstract class for all Transform constraints.
  6. /// </summary>
  7. [System.Serializable]
  8. public abstract class Constraint {
  9. #region Main Interface
  10. /// <summary>
  11. /// The transform to constrain.
  12. /// </summary>
  13. public Transform transform;
  14. /// <summary>
  15. /// %Constraint weight.
  16. /// </summary>
  17. public float weight;
  18. /// <summary>
  19. /// Gets a value indicating whether this <see cref="Constraint"/> is valid.
  20. /// </summary>
  21. /// <value>
  22. /// <c>true</c> if is valid; otherwise, <c>false</c>.
  23. /// </value>
  24. public bool isValid {
  25. get {
  26. return transform != null;
  27. }
  28. }
  29. /// <summary>
  30. /// Updates the constraint.
  31. /// </summary>
  32. public abstract void UpdateConstraint();
  33. #endregion Main Interface
  34. }
  35. }