暫無描述
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DefaultControl.cs 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System;
  2. using UnityEngine;
  3. namespace UnityEditor.U2D.Path.GUIFramework
  4. {
  5. /// <summary>
  6. /// Represents the default implementation of a control.
  7. /// </summary>
  8. public abstract class DefaultControl : Control
  9. {
  10. /// <summary>
  11. /// Default kPickDistance == 5.0f
  12. /// </summary>
  13. public static readonly float kPickDistance = 5f;
  14. /// <summary>
  15. /// Initializes and returns an instance of DefaultControl
  16. /// </summary>
  17. /// <param name="name">The name of the default control.</param>
  18. public DefaultControl(string name) : base(name)
  19. {
  20. }
  21. /// <summary>
  22. /// Overrides the Control.OnBeginLayout function.
  23. /// </summary>
  24. /// <remarks>
  25. /// Sets the LayoutData.distance to DefaultControl.kPickDistance.
  26. /// </remarks>
  27. /// <param name="data">The layout data.</param>
  28. /// <param name="guiState">The current state of the custom editor.</param>
  29. /// <returns>Returns the modified layout data.</returns>
  30. protected override LayoutData OnBeginLayout(LayoutData data, IGUIState guiState)
  31. {
  32. data.distance = kPickDistance;
  33. return data;
  34. }
  35. }
  36. }