UI Node Connect 4  v4.1
MeadowGames.UINodeConnect4.Port Class Reference

Inherits MaskableGraphic, MeadowGames.UINodeConnect4.IGraphElement, MeadowGames.UINodeConnect4.IDraggable, MeadowGames.UINodeConnect4.IClickable, and MeadowGames.UINodeConnect4.IHover.

Public Types

enum  PolarityType { _in, _out, _all }
 

Public Member Functions

override void SetMaterialDirty ()
 
override void SetVerticesDirty ()
 
void UpdateIcon ()
 
Connection ConnectTo (Port otherPort)
 
Connection ConnectTo (Port otherPort, Connection connectionTemplate)
 
void Remove ()
 
void RemoveAllConnections ()
 
void OnPointerDown ()
 
void OnPointerUp ()
 
void OnDrag ()
 
void OnPointerHoverEnter ()
 
void OnPointerHoverExit ()
 
List< NodeGetConnectedNodes ()
 
List< ConnectionGetOutConnections ()
 
List< ConnectionGetInConnections ()
 
Port GetOppositePort (Connection connection)
 
List< PortGetConnectedPorts ()
 
void SetControlPointLocalPosition (Vector3 position)
 
void SetControlPointDistanceAngle (float distance, float angle)
 
float GetControlPointAngle ()
 
void SetLocalPositionX (float position, bool nodeSizeProportion=false)
 Set the X position of the Port in relation to the node More...
 
void SetLocalPositionY (float position, bool nodeSizeProportion=false)
 Set the Y position of the Port in relation to the node More...
 

Public Attributes

new RectTransform rectTransform
 
GraphManager graphManager
 
Node node
 
int maxConnections = 0
 
Sprite iconUnconnected
 
Sprite iconConnected
 
Color iconColorDefault = new Color(0.98f, 0.94f, 0.84f)
 
Color iconColorHover = new Color(1, 0.81f, 0.3f)
 
Color iconColorSelected = new Color(1, 0.58f, 0.04f)
 
Color iconColorConnected = new Color(0.98f, 0.94f, 0.84f)
 
Image image
 
PortControlPoint controlPoint
 
int Priority => 2
 
Port lastFoundPort
 

Protected Member Functions

override void OnPopulateMesh (VertexHelper vh)
 
override void OnEnable ()
 
override void OnDisable ()
 
override void Awake ()
 
override void Start ()
 
override void OnDestroy ()
 

Properties

string ID [get, set]
 
string SID [get, set]
 
PolarityType Polarity [get, set]
 
Color ElementColor [get, set]
 
bool EnableDrag [get, set]
 
bool EnableHover [get, set]
 
bool DisableClick [get, set]
 
bool HasSpots [get]
 
List< ConnectionConnections [get]
 
int ConnectionsCount [get]
 
- Properties inherited from MeadowGames.UINodeConnect4.IGraphElement
string ID [get, set]
 
string SID [get, set]
 
Color ElementColor [get, set]
 
- Properties inherited from MeadowGames.UINodeConnect4.IElement
int Priority [get]
 
- Properties inherited from MeadowGames.UINodeConnect4.IDraggable
bool EnableDrag [get, set]
 
- Properties inherited from MeadowGames.UINodeConnect4.IClickable
bool DisableClick [get]
 
- Properties inherited from MeadowGames.UINodeConnect4.IHover
bool EnableHover [get, set]
 

Member Function Documentation

◆ SetLocalPositionX()

void MeadowGames.UINodeConnect4.Port.SetLocalPositionX ( float  position,
bool  nodeSizeProportion = false 
)
inline

Set the X position of the Port in relation to the node

Parameters
positionposition or percent (if nodeSizeProportion = true)
nodeSizeProportionflag to indicate if the given position is atual position value or percent based on width of the node size

◆ SetLocalPositionY()

void MeadowGames.UINodeConnect4.Port.SetLocalPositionY ( float  position,
bool  nodeSizeProportion = false 
)
inline

Set the Y position of the Port in relation to the node

Parameters
positionposition or percent (if nodeSizeProportion = true)
nodeSizeProportionflag to indicate if the given position is atual position value or percent based on width of the node size