File size: 1,122 Bytes
18a519f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using UnityEngine;

namespace Unity.VisualScripting
{
    [Widget(typeof(ControlConnection))]
    public sealed class ControlConnectionWidget : UnitConnectionWidget<ControlConnection>
    {
        public ControlConnectionWidget(FlowCanvas canvas, ControlConnection connection) : base(canvas, connection) { }


        #region Drawing

        public override Color color => Color.white;

        protected override bool colorIfActive => !BoltFlow.Configuration.animateControlConnections || !BoltFlow.Configuration.animateValueConnections;

        #endregion


        #region Droplets

        protected override bool showDroplets => BoltFlow.Configuration.animateControlConnections;

        protected override Vector2 GetDropletSize()
        {
            return BoltFlow.Icons.valuePortConnected?[12].Size() ?? 12 * Vector2.one;
        }

        protected override void DrawDroplet(Rect position)
        {
            if (BoltFlow.Icons.valuePortConnected != null)
            {
                GUI.DrawTexture(position, BoltFlow.Icons.valuePortConnected[12]);
            }
        }

        #endregion
    }
}