protected override void register_parameters() { reduceMode = base.RegisterDropDown("ReduceTypeDropDown", "target_mode", new List <string>() { "Triangles", "Vertices", "Min Length" }, new List <int>() { (int)ReduceOp.TargetModes.TriangleCount, (int)ReduceOp.TargetModes.VertexCount, (int)ReduceOp.TargetModes.MinEdgeLength }); triangleCount = base.RegisterIntInput("TriangleCountInput", "triangle_count", new Interval1i(0, int.MaxValue)); trianglePanel = this.gameObject.FindChildByName("TriangleCountParam", true); vertexCount = base.RegisterIntInput("VertexCountInput", "vertex_count", new Interval1i(0, int.MaxValue)); vertexPanel = this.gameObject.FindChildByName("VertexCountParam", true); minEdgeLength = base.RegisterFloatInput("MinEdgeLengthInput", "min_edge_length", new Interval1d(0.0001, 100), "F8"); minEdgeLengthPanel = this.gameObject.FindChildByName("MinEdgeLengthParam", true); reproject = base.RegisterToggle("ReprojectToggle", "reproject"); replaceInput = base.RegisterToggle("ReplaceInputToggle", "replace_input"); statusText = UnityUIUtil.FindTextAndSet(this.gameObject, "StatusText", ""); }
private void Settings_OnNewSettings(PrintSettings settings) { nozzleWidth.text = CC.Settings.NozzleDiameterMM.ToString(); UnityUIUtil.SetBackgroundColor(nozzleWidth, CotangentUI.NormalSettingColor); filamentDiam.text = CC.Settings.FilamentDiameterMM.ToString(); UnityUIUtil.SetBackgroundColor(filamentDiam, CotangentUI.NormalSettingColor); nozzleTemp.text = CC.Settings.ExtruderTempC.ToString(); UnityUIUtil.SetBackgroundColor(nozzleTemp, CotangentUI.NormalSettingColor); bedTemp.text = CC.Settings.BedTempC.ToString(); UnityUIUtil.SetBackgroundColor(bedTemp, CotangentUI.NormalSettingColor); bedTempGO.SetVisible(CC.Settings.HasHeatedBed); printSpeed.text = CC.Settings.PrintSpeedMMS.ToString(); UnityUIUtil.SetBackgroundColor(printSpeed, CotangentUI.NormalSettingColor); fanSpeed.text = CC.Settings.FanSpeedX.ToString(); UnityUIUtil.SetBackgroundColor(fanSpeed, CotangentUI.NormalSettingColor); travelSpeed.text = CC.Settings.TravelSpeedMMS.ToString(); UnityUIUtil.SetBackgroundColor(travelSpeed, CotangentUI.NormalSettingColor); bedSizeX.text = CC.Settings.BedSizeXMM.ToString(); UnityUIUtil.SetBackgroundColor(bedSizeX, CotangentUI.NormalSettingColor); bedSizeY.text = CC.Settings.BedSizeYMM.ToString(); UnityUIUtil.SetBackgroundColor(bedSizeY, CotangentUI.NormalSettingColor); bedSizeZ.text = CC.Settings.BedSizeZMM.ToString(); UnityUIUtil.SetBackgroundColor(bedSizeZ, CotangentUI.NormalSettingColor); }
public static void ShowModalConfirmDialog( string title, string instructions, string confirmText, string cancelText, object target, Action <object> onAccept, Action <object> onCancel) { GameObject dialog = GameObject.Instantiate <GameObject>(Resources.Load <GameObject>("ModalConfirmCancelDialog")); UnityUIUtil.FindTextAndSet(dialog, "Title", title); UnityUIUtil.FindTextAndSet(dialog, "InfoText", instructions); UnityUIUtil.FindTextAndSet(dialog, "OKText", confirmText); UnityUIUtil.FindTextAndSet(dialog, "CancelText", cancelText); Button cancelButton = UnityUIUtil.FindButtonAndAddClickHandler(dialog, "Cancel", () => { if (onCancel != null) { onCancel(target); } context.RegisterNextFrameAction(() => { GameObject.Destroy(dialog); }); }); Button okButton = UnityUIUtil.FindButtonAndAddClickHandler(dialog, "OK", () => { onAccept(target); context.RegisterNextFrameAction(() => { GameObject.Destroy(dialog); }); }); okButton.Select(); MainUICanvas.AddChild(dialog, false); }
protected override void register_parameters() { closingMode = base.RegisterDropDown("FillTypeDropDown", "fill_type", new List <string>() { "Trivial", "Minimal", "Smooth" }, new List <int>() { (int)FillHolesTool.FillTypes.Trivial, (int)FillHolesTool.FillTypes.Minimal, (int)FillHolesTool.FillTypes.Smooth }); showHidden = base.RegisterToggle("ShowHiddenToggle", "show_hidden"); minimalPanel = this.gameObject.FindChildByName("MinimalPanel", true); smoothPanel = this.gameObject.FindChildByName("SmoothPanel", true); fillAllButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "FillAllButton", on_fill_all_clicked); minOptimizeTris = base.RegisterToggle("MinimalOptimizeTrisToggle", "optimize_tris"); minOptTrisTolerance = base.RegisterFloatInput("MinimalOptTrisTolInput", "optimize_tris_deviation_thresh", new Interval1d(0, 1)); smoothAutoTargetEdgeLen = base.RegisterToggle("AutoEdgeLengthToggle", "auto_edge_length"); smoothTargetEdgeLen = base.RegisterFloatInput("TargetEdgeLenInput", "edge_length", new Interval1d(0.01, 100)); smoothOptRounds = base.RegisterIntInput("OptimizationRoundsInput", "smooth_opt_rounds", new Interval1i(1, 999)); statusText = UnityUIUtil.FindTextAndSet(this.gameObject, "StatusText", ""); }
protected override void register_parameters() { wallthickness = base.RegisterFloatInput("WallThicknessInput", "wall_thickness", new Interval1d(0.0001f, 9999f)); simpleCellSize = base.RegisterFloatInput("SimpleCellSizeInput", "all_cell_size", new Interval1d(0.25f, 500.0f)); simpleCellSizeRow = this.gameObject.FindChildByName("SimpleCellSizeParam", true); gridCellCount = base.RegisterIntInput("GridCellCountInput", "grid_cell_count", new Interval1i(4, 2048)); gridCellCountRow = this.gameObject.FindChildByName("GridCellCountParam", true); gridCellSize = base.RegisterFloatInput("GridCellSizeInput", "grid_cell_size", new Interval1d(0.001f, 500.0f)); gridCellSizeRow = this.gameObject.FindChildByName("GridCellSizeParam", true); meshCellCount = base.RegisterIntInput("MeshCellCountInput", "mesh_cell_count", new Interval1i(4, 2048)); meshCellCountRow = this.gameObject.FindChildByName("MeshCellCountParam", true); meshCellSize = base.RegisterFloatInput("MeshCellSizeInput", "mesh_cell_size", new Interval1d(0.001f, 500.0f)); meshCellSizeRow = this.gameObject.FindChildByName("MeshCellSizeParam", true); minComponentSize = base.RegisterFloatInput("MinComponentSizeInput", "min_component_size", new Interval1d(0.0f, 500.0f)); minComponentSizeRow = this.gameObject.FindChildByName("MinComponentSizeParam", true); enableInfill = base.RegisterToggle("EnableInfillToggle", "add_infill"); infillThickness = base.RegisterFloatInput("InfillThicknessInput", "infill_thickness", new Interval1d(1.0f, 500.0f)); infillThicknessRow = this.gameObject.FindChildByName("InfillThicknessParam", true); infillSpacing = base.RegisterFloatInput("InfillSpacingInput", "infill_spacing", new Interval1d(1.0f, 500.0f)); infillSpacingRow = this.gameObject.FindChildByName("InfillSpacingParam", true); showInputObjects = base.RegisterToggle("ShowOriginalToggle", "show_original"); replaceInput = base.RegisterToggle("ReplaceInputToggle", "replace_input"); basicButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "BasicToggleButton", on_basic_expert_toggle); TabOrder.Add(basicButton.gameObject); update_basic_expert_visibility(); }
public void Start() { CC.OnPrinterSelectionModified += CC_OnPrinterSelectionModified; CC.OnPresetSelectionModified += CC_OnPresetSelectionModified; CC.Settings.OnSettingModified += Settings_OnSettingModified; CC.PrinterDB.OnManufacturerListModified += OnManufacturerListModified; mfgDropDown = UnityUIUtil.FindDropDownAndAddHandlers("Manufacturer", () => { return(find_mfg_index(CC.PrinterDB.ActiveManufacturer)); }, (intValue) => { select_mfg_by_index(intValue); }); modelDropDown = UnityUIUtil.FindDropDownAndAddHandlers("Model", () => { return(find_model_index(CC.PrinterDB.ActiveMachine)); }, (intValue) => { select_model_by_index(intValue); }); presetDropDown = UnityUIUtil.FindDropDownAndAddHandlers("Preset", () => { return(find_preset_index(CC.PrinterDB.ActivePreset)); }, (intValue) => { select_preset_by_index(intValue); }); saveButton = UnityUIUtil.FindButtonAndAddClickHandler("PresetSaveButton", on_save_preset_clicked); UnityUIUtil.SetColors(saveButton, CotangentUI.ModifiedSettingColor, CotangentUI.DisabledButtonColor); resetButton = UnityUIUtil.FindButtonAndAddClickHandler("PresetResetButton", on_reset_preset_clicked); UnityUIUtil.SetColors(resetButton, CotangentUI.ModifiedSettingColor, CotangentUI.DisabledButtonColor); deleteButton = UnityUIUtil.FindButtonAndAddClickHandler("PresetDeleteButton", on_delete_preset_clicked); UnityUIUtil.SetColors(saveButton, CotangentUI.ModifiedSettingColor, CotangentUI.DisabledButtonColor); editButton = UnityUIUtil.FindButtonAndAddClickHandler("PresetEditButton", on_edit_preset_clicked); panel_requires_update = true; }
private void Settings_OnNewSettings(PrintSettings settings) { generateSupport.isOn = CC.Settings.GenerateSupport; UnityUIUtil.SetBackgroundColor(generateSupport, CotangentUI.NormalSettingColor); overhangAngle.text = CC.Settings.OverhangAngleDeg.ToString(); UnityUIUtil.SetBackgroundColor(overhangAngle, CotangentUI.NormalSettingColor); supportMinZTips.isOn = CC.Settings.SupportMinZTips; UnityUIUtil.SetBackgroundColor(supportMinZTips, CotangentUI.NormalSettingColor); supportSpacing.text = CC.Settings.SupportStepX.ToString(); UnityUIUtil.SetBackgroundColor(supportSpacing, CotangentUI.NormalSettingColor); supportShell.isOn = CC.Settings.EnableSupportShell; UnityUIUtil.SetBackgroundColor(supportShell, CotangentUI.NormalSettingColor); supportReleaseOpt.isOn = CC.Settings.EnableSupportReleaseOpt; UnityUIUtil.SetBackgroundColor(supportReleaseOpt, CotangentUI.NormalSettingColor); supportGap.text = CC.Settings.SupportSolidSpace.ToString(); UnityUIUtil.SetBackgroundColor(supportGap, CotangentUI.NormalSettingColor); update_visibility(); }
public void Start() { // Machine Settings panel CC.Settings.OnNewSettings += Settings_OnNewSettings; CC.Settings.OnSettingModified += Settings_OnSettingModified; layerRangeMin = UnityUIUtil.FindInputAndAddIntHandlers(this.gameObject, "LayerRangeMinInputField", () => { return(CC.Settings.LayerRangeMin); }, (intValue) => { CC.Settings.LayerRangeMin = intValue; }, 1, 999999); layerRangeMax = UnityUIUtil.FindInputAndAddIntHandlers(this.gameObject, "LayerRangeMaxInputField", () => { return(CC.Settings.LayerRangeMax); }, (intValue) => { CC.Settings.LayerRangeMax = intValue; }, 1, 999999999 + 1); startLayers = UnityUIUtil.FindInputAndAddIntHandlers(this.gameObject, "StartLayersInputField", () => { return(CC.Settings.StartLayers); }, (intValue) => { CC.Settings.StartLayers = intValue; }, 0, 100); startLayerHeight = UnityUIUtil.FindInputAndAddFloatHandlers(this.gameObject, "StartLayerHeightInputField", () => { return((float)CC.Settings.StartLayerHeightMM); }, (floatValue) => { CC.Settings.StartLayerHeightMM = Math.Round(floatValue, 5); }, 0.01f, 10.0f); startLayerHeightRow = startLayerHeight.transform.parent.gameObject; is_expanded = true; update_visibility(); }
private void Settings_OnSettingModified(PrintSettings settings) { SingleMaterialFFFSettings S = CC.PrinterDB.ActivePreset.Settings as SingleMaterialFFFSettings; if (generateSupport.isOn != CC.Settings.GenerateSupport) { generateSupport.isOn = CC.Settings.GenerateSupport; } UnityUIUtil.SetBackgroundColor(generateSupport, settings.GenerateSupport_Modified ? CotangentUI.ModifiedSettingColor : CotangentUI.NormalSettingColor); UnityUIUtil.SetBackgroundColor(overhangAngle, settings.OverhangAngleDeg_Modified? CotangentUI.ModifiedSettingColor : CotangentUI.NormalSettingColor); UnityUIUtil.SetBackgroundColor(supportMinZTips, settings.SupportMinZTips_Modified? CotangentUI.ModifiedSettingColor : CotangentUI.NormalSettingColor); UnityUIUtil.SetBackgroundColor(supportSpacing, settings.SupportStepX_Modified ? CotangentUI.ModifiedSettingColor : CotangentUI.NormalSettingColor); UnityUIUtil.SetBackgroundColor(supportShell, settings.EnableSupportShell_Modified ? CotangentUI.ModifiedSettingColor : CotangentUI.NormalSettingColor); UnityUIUtil.SetBackgroundColor(supportReleaseOpt, settings.EnableSupportReleaseOpt_Modified ? CotangentUI.ModifiedSettingColor : CotangentUI.NormalSettingColor); UnityUIUtil.SetBackgroundColor(supportGap, settings.SupportSolidSpace_Modified? CotangentUI.ModifiedSettingColor : CotangentUI.NormalSettingColor); update_visibility(); }
protected override void register_parameters() { offsetDistance = base.RegisterFloatInput("DistanceInput", "distance", new Interval1d(-500, 500)); simpleCellSize = base.RegisterFloatInput("SimpleCellSizeInput", "all_cell_size", new Interval1d(0.25f, 500.0f)); simpleCellSizeRow = this.gameObject.FindChildByName("SimpleCellSizeParam", true); gridCellCount = base.RegisterIntInput("GridCellCountInput", "grid_cell_count", new Interval1i(4, 2048)); gridCellCountRow = this.gameObject.FindChildByName("GridCellCountParam", true); gridCellSize = base.RegisterFloatInput("GridCellSizeInput", "grid_cell_size", new Interval1d(0.001f, 500.0f)); gridCellSizeRow = this.gameObject.FindChildByName("GridCellSizeParam", true); meshCellCount = base.RegisterIntInput("MeshCellCountInput", "mesh_cell_count", new Interval1i(4, 2048)); meshCellCountRow = this.gameObject.FindChildByName("MeshCellCountParam", true); meshCellSize = base.RegisterFloatInput("MeshCellSizeInput", "mesh_cell_size", new Interval1d(0.001f, 500.0f)); meshCellSizeRow = this.gameObject.FindChildByName("MeshCellSizeParam", true); minComponentSize = base.RegisterFloatInput("MinComponentSizeInput", "min_component_size", new Interval1d(0.0f, 500.0f)); minComponentSizeRow = this.gameObject.FindChildByName("MinComponentSizeParam", true); replaceInput = base.RegisterToggle("ReplaceInputToggle", "replace_input"); basicButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "BasicToggleButton", on_basic_expert_toggle); TabOrder.Add(basicButton.gameObject); }
private void Settings_OnSettingModified(PrintSettings settings) { SingleMaterialFFFSettings S = CC.PrinterDB.ActivePreset.Settings as SingleMaterialFFFSettings; UnityUIUtil.SetBackgroundColor(nozzleWidth, settings.NozzleDiameterMM_Modified ? CotangentUI.ModifiedSettingColor : CotangentUI.NormalSettingColor); UnityUIUtil.SetBackgroundColor(filamentDiam, settings.FilamentDiameterMM_Modified ? CotangentUI.ModifiedSettingColor : CotangentUI.NormalSettingColor); UnityUIUtil.SetBackgroundColor(nozzleTemp, settings.ExtruderTempC_Modified ? CotangentUI.ModifiedSettingColor : CotangentUI.NormalSettingColor); UnityUIUtil.SetBackgroundColor(bedTemp, settings.BedTempC_Modified ? CotangentUI.ModifiedSettingColor : CotangentUI.NormalSettingColor); UnityUIUtil.SetBackgroundColor(printSpeed, settings.PrintSpeedMMS_Modified ? CotangentUI.ModifiedSettingColor : CotangentUI.NormalSettingColor); UnityUIUtil.SetBackgroundColor(travelSpeed, settings.TravelSpeedMMS_Modified ? CotangentUI.ModifiedSettingColor : CotangentUI.NormalSettingColor); UnityUIUtil.SetBackgroundColor(fanSpeed, settings.FanSpeedX_Modified? CotangentUI.ModifiedSettingColor : CotangentUI.NormalSettingColor); UnityUIUtil.SetBackgroundColor(bedSizeX, settings.BedSizeXMM_Modified ? CotangentUI.ModifiedSettingColor : CotangentUI.NormalSettingColor); UnityUIUtil.SetBackgroundColor(bedSizeY, settings.BedSizeYMM_Modified ? CotangentUI.ModifiedSettingColor : CotangentUI.NormalSettingColor); UnityUIUtil.SetBackgroundColor(bedSizeZ, settings.BedSizeZMM_Modified ? CotangentUI.ModifiedSettingColor : CotangentUI.NormalSettingColor); }
protected override void register_parameters() { unionButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "UnionButton", on_union); differenceButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "DifferenceButton", on_difference); intersectButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "IntersectButton", on_intersection); simpleCellSize = base.RegisterFloatInput("SimpleCellSizeInput", "all_cell_size", new Interval1d(0.25f, 500.0f)); simpleCellSizeRow = this.gameObject.FindChildByName("SimpleCellSizeParam", true); gridCellCount = base.RegisterIntInput("GridCellCountInput", "grid_cell_count", new Interval1i(4, 2048)); gridCellCountRow = this.gameObject.FindChildByName("GridCellCountParam", true); gridCellSize = base.RegisterFloatInput("GridCellSizeInput", "grid_cell_size", new Interval1d(0.001f, 500.0f)); gridCellSizeRow = this.gameObject.FindChildByName("GridCellSizeParam", true); meshCellCount = base.RegisterIntInput("MeshCellCountInput", "mesh_cell_count", new Interval1i(4, 2048)); meshCellCountRow = this.gameObject.FindChildByName("MeshCellCountParam", true); meshCellSize = base.RegisterFloatInput("MeshCellSizeInput", "mesh_cell_size", new Interval1d(0.001f, 500.0f)); meshCellSizeRow = this.gameObject.FindChildByName("MeshCellSizeParam", true); minComponentSize = base.RegisterFloatInput("MinComponentSizeInput", "min_component_size", new Interval1d(0.0f, 500.0f)); minComponentSizeRow = this.gameObject.FindChildByName("MinComponentSizeParam", true); replaceInput = base.RegisterToggle("ReplaceInputToggle", "replace_input"); basicButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "BasicToggleButton", on_basic_expert_toggle); TabOrder.Add(basicButton.gameObject); // always starts w/ union? UnityUIUtil.SetColors(unionButton, Colorf.LightGreen, Colorf.DimGrey); }
private void Settings_OnNewSettings(PrintSettings settings) { layerHeight.text = CC.Settings.LayerHeightMM.ToString(); UnityUIUtil.SetBackgroundColor(layerHeight, CotangentUI.NormalSettingColor); infill.text = CC.Settings.InfillStepX.ToString(); UnityUIUtil.SetBackgroundColor(infill, CotangentUI.NormalSettingColor); shells.text = CC.Settings.OuterShells.ToString(); UnityUIUtil.SetBackgroundColor(shells, CotangentUI.NormalSettingColor); roofLayers.text = CC.Settings.RoofLayers.ToString(); UnityUIUtil.SetBackgroundColor(roofLayers, CotangentUI.NormalSettingColor); floorLayers.text = CC.Settings.FloorLayers.ToString(); UnityUIUtil.SetBackgroundColor(floorLayers, CotangentUI.NormalSettingColor); interiorSolidRegionShells.text = CC.Settings.InteriorSolidRegionShells.ToString(); UnityUIUtil.SetBackgroundColor(interiorSolidRegionShells, CotangentUI.NormalSettingColor); clipOverlaps.isOn = CC.Settings.ClipSelfOverlaps; UnityUIUtil.SetBackgroundColor(clipOverlaps, CotangentUI.NormalSettingColor); openMeshMode.value = CC.Settings.OpenModeInt; }
public void Update() { if (exportGCodeButton != null) { exportGCodeButton.gameObject.SetVisible(CCActions.CurrentViewMode == AppViewMode.PrintView); } if (exportGCodeButton != null && exportGCodeButton.gameObject.IsVisible()) { exportGCodeButton.interactable = CC.Toolpather.ToolpathsValid; } if (exportMeshButton != null) { exportMeshButton.interactable = CC.Objects.PrintMeshes.Count > 0; } if (CCActions.HaveActiveSaveFile && CCActions.CurrentSceneModified) { UnityUIUtil.SetColors(saveButton, CotangentUI.ModifiedSettingColor, CotangentUI.DisabledButtonColor); } else { UnityUIUtil.SetColors(saveButton, CotangentUI.NormalSettingColor, CotangentUI.DisabledButtonColor); } }
// Use this for initialization public void Start() { printModeButton = UnityUIUtil.FindButtonAndAddClickHandler("PrintButton", on_print_mode); repairModeButton = UnityUIUtil.FindButtonAndAddClickHandler("RepairButton", on_repair_mode); modelModeButton = UnityUIUtil.FindButtonAndAddClickHandler("ModelButton", on_model_mode); set_highlight(AppViewMode.PrintView); highlighted = AppViewMode.PrintView; }
void standard_update_toggle_button(bool bValue, Button button) { Colorf onColor = Colorf.LightGreen; Colorf offColor = Colorf.Silver; Colorf disabledColor = Colorf.DimGrey; UnityUIUtil.SetColors(button, (bValue) ? onColor : offColor, disabledColor); }
// Use this for initialization public void Start() { acceptButton = UnityUIUtil.FindButtonAndAddClickHandler("AcceptButton", on_accept); cancelButton = UnityUIUtil.FindButtonAndAddClickHandler("CancelButton", on_cancel); UnityUIUtil.SetColors(acceptButton, canAcceptColor, cantAcceptColor); UnityUIUtil.SetColors(cancelButton, cancelColor, cantAcceptColor); }
// Use this for initialization public void Start() { okButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "OKButton", on_ok_clicked); cancelButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "CancelButton", on_cancel_clicked); submitNewButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "SubmitButton", on_submit_clicked); MfgListView = UnityUtil.FindChildByName(this.gameObject, "ManufacturerListView"); populate_list(); }
public void Start() { ITool curTool = CC.ActiveContext.ToolManager.ActiveRightTool; if (curTool == null) { return; } Tool = curTool as MeshEditorTool; if (Tool == null) { return; } ActiveParameterSet = Tool.Parameters; deleteTri = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "DeleteTriangleButton", () => { clear_selection(); set_selection(deleteTri, MeshEditorTool.EditOperations.DeleteTriangle); }); deleteEdge = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "DeleteEdgeButton", () => { clear_selection(); set_selection(deleteEdge, MeshEditorTool.EditOperations.DeleteEdge); }); deleteVtx = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "DeleteVertexButton", () => { clear_selection(); set_selection(deleteVtx, MeshEditorTool.EditOperations.DeleteVertex); }); deleteComponent = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "DeleteComponentButton", () => { clear_selection(); set_selection(deleteComponent, MeshEditorTool.EditOperations.DeleteComponent); }); deleteRing = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "DeleteRingButton", () => { clear_selection(); set_selection(deleteRing, MeshEditorTool.EditOperations.DeleteBorderRing); }); collapseEdge = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "CollapseButton", () => { clear_selection(); set_selection(collapseEdge, MeshEditorTool.EditOperations.CollapseEdge); }); flipEdge = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "FlipButton", () => { clear_selection(); set_selection(flipEdge, MeshEditorTool.EditOperations.FlipEdge); }); splitEdge = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "SplitButton", () => { clear_selection(); set_selection(splitEdge, MeshEditorTool.EditOperations.SplitEdge); }); pokeFace = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "PokeTriangleButton", () => { clear_selection(); set_selection(pokeFace, MeshEditorTool.EditOperations.PokeTriangle); }); bridgeEdges = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "BridgeButton", () => { clear_selection(); set_selection(bridgeEdges, MeshEditorTool.EditOperations.BridgeEdges); }); allowBackface = UnityUIUtil.FindToggleAndConnectToSource(this.gameObject, "BackfaceToggle", () => { return(ActiveParameterSet.GetValueBool("allow_backface_hits")); }, (boolValue) => { ActiveParameterSet.SetValue("allow_backface_hits", boolValue); }); set_selection(deleteTri, MeshEditorTool.EditOperations.DeleteTriangle); }
protected override void register_parameters() { fillHoles = base.RegisterToggle("FillHolesToggle", "fill_holes"); otherSide = base.RegisterToggle("FlipSideToggle", "reverse_normal"); keepBoth = base.RegisterToggle("KeepBothToggle", "keep_both"); minimalFill = base.RegisterToggle("MinimalFillToggle", "minimal_fill"); fillEdgeLength = base.RegisterFloatInput("FillEdgeLengthInput", "fill_edge_length", new Interval1d(0.01, 10000)); setPlaneButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "SetPlaneFromClickButton", on_set_plane_clicked); }
// Use this for initialization public void Start() { dismissButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "DimissButton", dismiss_on_click); start_time = FPlatform.RealTime(); if (FPlatform.InUnityEditor()) { dismiss_on_click(); } }
private void Settings_OnNewSettings(PrintSettings settings) { enableBridging.isOn = CC.Settings.EnableBridging; UnityUIUtil.SetBackgroundColor(enableBridging, CotangentUI.NormalSettingColor); maxDistance.text = CC.Settings.MaxBridgeDistanceMM.ToString(); UnityUIUtil.SetBackgroundColor(maxDistance, CotangentUI.NormalSettingColor); update_visibility(); }
// Use this for initialization public void Start() { installNowButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "InstallNowButton", install_now); installOnExitButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "InstallOnExitButton", install_on_exit); installLaterButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "InstallLaterButton", install_later); downloadPanel = this.gameObject.FindChildByName("DownloadPanel", true); downloadText = UnityUIUtil.FindText(this.gameObject, "DownloadingText"); cancelButton = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "CancelButton", cancel_download); downloadPanel.SetVisible(false); }
// Use this for initialization public void Start() { try { undoButton = UnityUIUtil.FindButtonAndAddClickHandler("UndoButton", on_undo_clicked); redoButton = UnityUIUtil.FindButtonAndAddClickHandler("RedoButton", on_redo_clicked); fitToViewButton = UnityUIUtil.FindButtonAndAddClickHandler("FitToViewButton", on_fit_view_clicked); prefsButton = UnityUIUtil.FindButtonAndAddClickHandler("PreferencesButton", () => { CCActions.ShowPreferencesDialog(); }); } catch (Exception e) { DebugUtil.Log("ScenePanelSetup Start(): " + e.Message); } }
void set_to_tab(GameObject panel, Button button) { prefsTab.SetVisible(false); UnityUIUtil.SetColors(prefsTabButton, Colorf.White, Colorf.White); privacyTab.SetVisible(false); UnityUIUtil.SetColors(privacyTabButton, Colorf.White, Colorf.White); aboutTab.SetVisible(false); UnityUIUtil.SetColors(aboutTabButton, Colorf.White, Colorf.White); panel.SetVisible(true); UnityUIUtil.SetColors(button, Colorf.LightGreen, Colorf.LightGreen); }
// Use this for initialization public void Start() { Panel = this.gameObject; Canvas = Panel.transform.parent.gameObject; objectsButton = UnityUIUtil.FindButtonAndAddClickHandler("ObjectsButton", on_objects_clicked); positionButton = UnityUIUtil.FindButtonAndAddClickHandler("PositionButton", on_position_clicked); printUtilButton = UnityUIUtil.FindButtonAndAddClickHandler("PrintUtilButton", on_print_util_clicked); standard_colors = objectsButton.colors; active_colors = standard_colors; active_colors.normalColor = active_colors.pressedColor; active_colors.highlightedColor = active_colors.pressedColor; }
private void Settings_OnSettingModified(PrintSettings settings) { SingleMaterialFFFSettings S = CC.PrinterDB.ActivePreset.Settings as SingleMaterialFFFSettings; UnityUIUtil.SetBackgroundColor(enableBridging, settings.EnableBridging_Modified ? CotangentUI.ModifiedSettingColor : CotangentUI.NormalSettingColor); UnityUIUtil.SetBackgroundColor(maxDistance, settings.MaxBridgeDistanceMM_Modified? CotangentUI.ModifiedSettingColor : CotangentUI.NormalSettingColor); update_visibility(); }
// Use this for initialization public void Start() { try { statusBG = this.gameObject.FindChildByName("StatusBG", true); statusBGImage = statusBG.GetComponent <Image>(); statusText = UnityUIUtil.FindText(statusBG, "StatusText"); statusBG.SetVisible(false); } catch (Exception e) { DebugUtil.Log("StatusPanelSetup Start(): " + e.Message); } }
// Use this for initialization public void Start() { Panel = this.gameObject; Canvas = Panel.transform.parent.gameObject; healToolsButton = UnityUIUtil.FindButtonAndAddClickHandler("HealButton", on_heal_clicked); triToolsButton = UnityUIUtil.FindButtonAndAddClickHandler("TriToolsButton", on_tritools_clicked); modelToolsButton = UnityUIUtil.FindButtonAndAddClickHandler("ModelToolsButton", on_modeltools_clicked); objectsButton = UnityUIUtil.FindButtonAndAddClickHandler("ObjectsButton", on_objects_clicked); standard_colors = healToolsButton.colors; active_colors = standard_colors; active_colors.normalColor = active_colors.pressedColor; active_colors.highlightedColor = active_colors.pressedColor; }
// Use this for initialization public void Start() { sceneButton = UnityUIUtil.FindButtonAndAddClickHandler("SceneTab", on_scene); objectButton = UnityUIUtil.FindButtonAndAddClickHandler("ObjectTab", on_object); scenePanel = this.gameObject.FindChildByName("SceneScrollView", true); objectPanel = this.gameObject.FindChildByName("ObjectScrollView", true); visiblePanel = VisiblePanel.ObjectPanel; update_visibility(); panelSetup = this; }