Vector2 p1 = Pos[0].position; Vector2 p2= Pos[1].position; Vector2 p3 = Pos[2].position; if ((p2.x - p1.x) *(p3.y - p1.y) -(p3.x - p1.x) *(p2.y-p1.y) < 0) { Debug.Log("顺时针") ; } else { Debug.Log("逆时针") ; }
Vector2 p1 = Pos[0].position; Vector2 p2= Pos[1].position; Vector2 p3 = Pos[2].position; if ((p2.x - p1.x) *(p3.y - p1.y) -(p3.x - p1.x) *(p2.y-p1.y) < 0) { Debug.Log("顺时针") ; } else { Debug.Log("逆时针") ; }