static void Init() { // Get existing open window or if none, make a new one: UnityRandomEditorWindow window = (UnityRandomEditorWindow)EditorWindow.GetWindow(typeof(UnityRandomEditorWindow), false, "UNITY RANDOM"); window.Show(); }
public static void DrawV3Plot(ArrayList rlist, int width, int height, UnityRandomEditorWindow.RandomVector3DType _type, float alpha, float beta) { foreach ( object obj in rlist ) { Vector2 _pos = MapTo2D( (Vector3) obj, alpha, beta); // rotation (alpha,beta) // move from space -1 - 1 to space 0-1 _pos = ((_pos + Vector2.one) * 0.5f); DrawPoint( Vector2.Scale(_pos, new Vector2(width, height))); } }
public static void DrawV2Plot(ArrayList rlist, int width, int height, UnityRandomEditorWindow.RandomVector2DType _type) { foreach ( object obj in rlist ) { Vector2 pos = ((Vector2) obj + Vector2.one) * 0.5f; switch (_type) { case UnityRandomEditorWindow.RandomVector2DType.SQUARE: DrawPoint( Vector2.Scale( pos, new Vector2(width, height)) ); break; case UnityRandomEditorWindow.RandomVector2DType.CIRCLE: DrawPoint( Vector2.Scale( pos, new Vector2(width, height) ) ); break; case UnityRandomEditorWindow.RandomVector2DType.DISK: DrawPoint( Vector2.Scale( pos, new Vector2(width, height) ) ); break; default: break; } } }