protected virtual void ShowProfilePreview(SerializedProperty profile) { if (!profile.isArray) { return; } EditorGUILayout.PropertyField(profile); if (profile.isExpanded) { EditorGUI.indentLevel += 1; EditorGUILayout.BeginHorizontal(); EditorGUILayout.BeginVertical(); var polygon = GetPolygonFromProfile(profile); DrawPreview(polygon); if (GUILayout.Button("Edit profile...")) { PolygonEditor polygonWindow = EditorWindow.GetWindow <PolygonEditor>(false, "Polygon Editor", true); polygonWindow.maxSize = new Vector2(1000, 1000); polygonWindow.Show(); } EditorGUILayout.EndVertical(); EditorGUILayout.EndHorizontal(); EditorGUI.indentLevel -= 1; } }
public static void Init() { PolygonEditor polygonWindow = GetWindow <PolygonEditor>(false, "Polygon Editor", true); polygonWindow.maxSize = new Vector2(1000, 1000); polygonWindow.Show(); polygonWindow.Populate(); }