Ejemplo n.º 1
0
        private void DrawShape()
        {
            shapeItems.Clear();

            foreach (var cachedShape in P3dShape.CachedShapes)
            {
                if (cachedShape != null)
                {
                    shapeItems.Add(cachedShape);
                }
            }

            shapeScrollPosition = GUILayout.BeginScrollView(shapeScrollPosition, GUILayout.ExpandHeight(true));
            var selected = DrawBrowser(shapeItems, Settings.CurrentShape);

            if (selected != null)
            {
                LoadShape((P3dShape)selected); selectingShape = false;
            }
            GUILayout.EndScrollView();

            EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);
            Settings.IconSize = EditorGUILayout.IntSlider(Settings.IconSize, 32, 256);

            EditorGUILayout.Separator();

            if (GUILayout.Button("Refresh", EditorStyles.toolbarButton, GUILayout.ExpandWidth(false)) == true)
            {
                P3dShape.ClearCache(); AssetDatabase.Refresh();
            }
            EditorGUILayout.EndHorizontal();
        }
Ejemplo n.º 2
0
        private void LoadShape(P3dShape prefab)
        {
            Settings.CurrentShape = prefab;

            Repaint();
        }