Ejemplo n.º 1
0
 void _Slice(Rect rect, int slots)
 {
     rect.height += slots * rect.height;
     //rect.x += 2 * rect.width;
     //if (dropdown != Dropdown.File) return;
     GUILayout.BeginHorizontal();
     {
         GUILayout.Space(rect.xMin);
         GUILayout.BeginVertical();
         {
             if (GUILayout.Button("Slice","dd"))
             {
                 csGCD = new cSectionGCD();
                 index = 100;
                 dropdown = Dropdown.None;
                 return;
             }
             if (GUILayout.Button("Slicer Panel", "dd"))
             {
                 if (slicerForm == null)
                 {
                     slicerForm = new SlicerForm.SlicerForm();
                     SlicerForm.SlicerForm.buttonPressed += ButtonPressed;
                 }
                 slicerForm.Show();
                 index = 100;
                 dropdown = Dropdown.None;
                 return;
             }
             if (GUILayout.Button("Paths", "dd"))
             {
                 index = 100;
                 slicerForm.Hide();
                 dropdown = Dropdown.None;
                 return;
             }
         }
         GUILayout.EndVertical();
     }
     GUILayout.EndHorizontal();
     var mp = Input.mousePosition;
     mp.y = UnityEngine.Screen.height - mp.y;
     if (mp.x <= rect.xMax
         && mp.x >= rect.xMin
         && mp.y <= rect.yMax
         && mp.y >= rect.yMin)
     {
         index = 2;
     }
     else
     {
         index = 100;
         dropdown = Dropdown.None;
     }
 }
Ejemplo n.º 2
0
 private void ButtonPressed(string _name, bool _active)
 {
     switch (_name)
     {
         case "Slice":
             csGCD = new cSectionGCD();
             break;
         case "Radio_step":
             cSectionGCD.csMode = cSectionGCD.CsMode.StepThrough;
             break;
         case "Radio_gcd":
             cSectionGCD.csMode = cSectionGCD.CsMode.ByGcdCode;
             break;
         case "Radio_wt":
             if (!CheckWalls.WallsChecked)
                 wt = new CheckWalls(cSectionGCD.layers);
             wt.SetSloxelWT();
             cSectionGCD.csMode = cSectionGCD.CsMode.WallThickness;
             break;
         case "Radio_none":
             cSectionGCD.csMode = cSectionGCD.CsMode.None;
             break;
         default:
             break;
     }
 }