Exemplo n.º 1
0
        private void ShowResize()
        {
            using (var view = new EditorGUILayout.HorizontalScope(GUILayout.Height(75)))
            {
                Rect[] _rtList = view.rect.Division(new float[] { 0.3f, 0.05f, 0.3f, 0.05f, 0.3f }, null);

                float fSize;

                using (new GUIBackgroundColorScope(Util.CustomEditorGUI.Color_LightRed))
                {
                    fSize = _SizeXZ.rectValue.width + 1;
                    ShowResizeAxis(_rtList[0], string.Format("Size X({0})", fSize), true);
                }
                using (new GUIBackgroundColorScope(Util.CustomEditorGUI.Color_LightGreen))
                {
                    fSize = _SizeXZ.rectValue.height + 1;
                    ShowResizeAxis(_rtList[2], string.Format("Size Z({0})", fSize), false);
                }
                using (new GUIBackgroundColorScope(Util.CustomEditorGUI.Color_LightBlue))
                {
                    using (new EditorGUILayout.VerticalScope())
                    {
                        _rtList = _rtList[4].Division(null, new float[] { 0.15f, 0.25f, 0.05f, 0.25f, 0.05f, 0.25f });
                        if (GUI.Button(_rtList[1], "No Redundancy"))
                        {
                            _bulk.NoRedundancy();
                            refresh_Child(true);
                        }

                        if (GUI.Button(_rtList[3], "Flat"))
                        {
                            _bulk.Flat();
                            refresh_Child(true);
                        }

                        if (GUI.Button(_rtList[5], "Clear"))
                        {
                            _bulk.Clear();
                            refresh_Child(true);
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        public IsoTileBulk NewBulk(IsoTileBulk syncWith, IEnumerable <IsoTile> tiles)
        {
            IsoTileBulk _newBulk = NewBulk();

            _newBulk.bAllowEmptyBulk = true;
            _newBulk.Clear();
            _newBulk.Sync(syncWith);
            var enumerator = tiles.GetEnumerator();

            while (enumerator.MoveNext())
            {
                var current = enumerator.Current;
                Undo.SetTransformParent(current.transform, _newBulk.transform, "IsoTile: Split Bulk");
                current.transform.parent = _newBulk.transform;
            }
            _newBulk.bAllowEmptyBulk   = false;
            Selection.activeGameObject = _newBulk.gameObject;
            EditorGUIUtility.PingObject(_newBulk.gameObject);
            return(_newBulk);
        }