static private DrawCross ( |
||
p | ||
col | ||
size | float | |
Résultat | void |
static void DrawCross (Vector2 p, Color col, float size = 1) {
size *= 0.5f;
Debug.DrawLine(new Vector3(p.x, 0, p.y) - Vector3.right*size, new Vector3(p.x, 0, p.y) + Vector3.right*size, col);
Debug.DrawLine(new Vector3(p.x, 0, p.y) - Vector3.forward*size, new Vector3(p.x, 0, p.y) + Vector3.forward*size, col);
}
Agent::DrawCross ( |
private Vector2 GradientDescent(Agent.VOBuffer vos, Vector2 sampleAround1, Vector2 sampleAround2) { float num; Vector2 vector = this.Trace(vos, sampleAround1, out num); if (this.DebugDraw) { Agent.DrawCross(vector + this.position, Color.yellow, 0.5f); } float num2; Vector2 vector2 = this.Trace(vos, sampleAround2, out num2); if (this.DebugDraw) { Agent.DrawCross(vector2 + this.position, Color.magenta, 0.5f); } return((num >= num2) ? vector2 : vector); }