Here are the examples of the csharp api RelationsInspector.BasicRelationDrawer.DrawMarker(P, UnityEngine.Vector2, UnityEngine.Vector2, UnityEngine.Vector2, UnityEngine.Texture2D, UnityEngine.Color, float) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Examples
19
View Source File : BasicRelation.cs
License : MIT License
Project Creator : seldomU
License : MIT License
Project Creator : seldomU
static Dictionary<Relation<T, P>, Rect> DrawMarkers( IEnumerable<Relation<T, P>> edges, Vector2 startPos, Vector2 endPos, Vector2 size, Texture2D image, System.Func<P, Color> GetMarkerColor )
{
if ( !edges.Any() )
return new Dictionary<Relation<T, P>, Rect>();
var markerRects = new Dictionary<Relation<T, P>, Rect>();
var edgeArray = edges.ToArray();
int numMarkers = edgeArray.Length;
float segmentSize = ( endPos - startPos ).magnitude / numMarkers;
for ( int i = 0; i < edgeArray.Length; i++ )
{
float position = ( i + 0.5f ) * segmentSize;
var edge = edgeArray[ i ];
markerRects[ edge ] = DrawMarker( edge.Tag, startPos, endPos, size, image, GetMarkerColor( edge.Tag ), position );
}
return markerRects;
}