No Description
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.

ControlConnectionWidget.cs 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using UnityEngine;
  2. namespace Unity.VisualScripting
  3. {
  4. [Widget(typeof(ControlConnection))]
  5. public sealed class ControlConnectionWidget : UnitConnectionWidget<ControlConnection>
  6. {
  7. public ControlConnectionWidget(FlowCanvas canvas, ControlConnection connection) : base(canvas, connection) { }
  8. #region Drawing
  9. public override Color color => Color.white;
  10. protected override bool colorIfActive => !BoltFlow.Configuration.animateControlConnections || !BoltFlow.Configuration.animateValueConnections;
  11. #endregion
  12. #region Droplets
  13. protected override bool showDroplets => BoltFlow.Configuration.animateControlConnections;
  14. protected override Vector2 GetDropletSize()
  15. {
  16. return BoltFlow.Icons.valuePortConnected?[12].Size() ?? 12 * Vector2.one;
  17. }
  18. protected override void DrawDroplet(Rect position)
  19. {
  20. if (BoltFlow.Icons.valuePortConnected != null)
  21. {
  22. GUI.DrawTexture(position, BoltFlow.Icons.valuePortConnected[12]);
  23. }
  24. }
  25. #endregion
  26. }
  27. }