public virtual Color NodeColor (GraphNode node, PathHandler data) {
#if !PhotonImplementation
Color c = AstarColor.NodeConnection;
bool colSet = false;
if (node == null) return AstarColor.NodeConnection;
switch (AstarPath.active.debugMode) {
case GraphDebugMode.Areas:
c = AstarColor.GetAreaColor (node.Area);
colSet = true;
break;
case GraphDebugMode.Penalty:
c = Color.Lerp (AstarColor.ConnectionLowLerp,AstarColor.ConnectionHighLerp, (float)node.Penalty / (float)AstarPath.active.debugRoof);
colSet = true;
break;
case GraphDebugMode.Tags:
c = AstarMath.IntToColor ((int)node.Tag,0.5F);
colSet = true;
break;
/* Wasn't really usefull
case GraphDebugMode.Position:
float r = Mathf.PingPong (node.position.x/10000F,1F) + Mathf.PingPong (node.position.x/300000F,1F);
float g = Mathf.PingPong (node.position.y/10000F,1F) + Mathf.PingPong (node.position.y/200000F,1F);
float b = Mathf.PingPong (node.position.z/10000F,1F) + Mathf.PingPong (node.position.z/100000F,1F);
c = new Color (r,g,b);
break;
*/
}
if (!colSet) {
if (data == null) return AstarColor.NodeConnection;
PathNode nodeR = data.GetPathNode (node);
switch (AstarPath.active.debugMode) {
case GraphDebugMode.G:
//c = Mathfx.IntToColor (node.g,0.5F);
c = Color.Lerp (AstarColor.ConnectionLowLerp,AstarColor.ConnectionHighLerp, (float)nodeR.G / (float)AstarPath.active.debugRoof);
break;
case GraphDebugMode.H:
c = Color.Lerp (AstarColor.ConnectionLowLerp,AstarColor.ConnectionHighLerp, (float)nodeR.H / (float)AstarPath.active.debugRoof);
break;
case GraphDebugMode.F:
c = Color.Lerp (AstarColor.ConnectionLowLerp,AstarColor.ConnectionHighLerp, (float)nodeR.F / (float)AstarPath.active.debugRoof);
break;
}
}
c.a *= 0.5F;
return c;
#else
return new Color (1,1,1);
#endif
}