public List <InspectorList> GetInspectorList(int ARCSCode) { connection.Open(); List <InspectorList> lstRM = new List <InspectorList>(); SqlCommand cmd = new SqlCommand("[dbo].[GetInspectorList]", connection) { CommandType = CommandType.StoredProcedure }; cmd.Parameters.AddWithValue("@ARCSCode", ARCSCode); var dr = cmd.ExecuteReader(); var dt = new DataTable(); if (dr.HasRows) { dt.Load(dr); if (dt.Rows.Count > 0) { foreach (DataRow r in dt.Rows) { InspectorList objRM = new InspectorList { InspectorCode = Convert.ToInt32(r["InspectorCode"]), InspectorName = r["InspectName"].ToString() }; lstRM.Add(objRM); } } } connection.Close(); return(lstRM); }
protected void doSubstancesGUI(SerializedObject ob) { SerializedProperty voxelSubstances = ob.FindProperty("voxelSubstances"); showSubstances = doBigFoldout(showSubstances, "Substances"); if (showSubstances) { InspectorList.doArrayGUISimple(ref voxelSubstances); } ob.ApplyModifiedProperties(); }
protected void doMaskGUI(Vox.VoxelEditor editor) { editor.maskDisplayAlpha = doSliderFloatField("Mask Display Transparency", editor.maskDisplayAlpha, 0, 1); // mask list showMasks = doBigFoldout(showMasks, "Masks"); if (showMasks) { SerializedProperty voxelMasks = serializedObject.FindProperty("masks"); // EditorGUILayout.PropertyField(voxelMasks, new GUIContent("Sculpting Masks"), true); InspectorList.doArrayGUISimple(ref voxelMasks); } }
protected override void OnEnable() { base.OnEnable(); terrain = serializedObject.FindProperty("terrain"); soundsSets = new InspectorList(serializedObject.FindProperty("soundsSets")); soundsSets.drawElementCallback = DrawSoundSetElement; soundsSets.displayAdd = false; soundsSets.displayRemove = false; soundsSets.draggable = false; }
public void RefreshSelectedList() { if (main.index == -1) { preview = null; } else { preview = new InspectorList(GetPreviewProperty(main.GetArrayElement(main.index))); InitPreview(preview); preview.serializedProperty.isExpanded = true; } }
static void LoadSettings() { settingsPath = PlayerPrefs.GetString(SETTINGS_PATH_KEY, ""); settings = null; //Find path. Try to load settings if (!string.IsNullOrEmpty(settingsPath)) { settings = AssetDatabase.LoadAssetAtPath <BuildManagerSettings>(settingsPath); if (settings == null) { settingsPath = null; } } //No path, or cant locate asset at path. Try to find settings in assets. if (string.IsNullOrEmpty(settingsPath)) { string[] guids = AssetDatabase.FindAssets("t:BuildManagerSettings"); if (guids.Length >= 2) { Debug.LogError("[BuildManagerWindow]. 2+ BuildManagerSettings exist. Consider on using only 1 setting. The first on will be used."); } if (guids.Length != 0) { settingsPath = AssetDatabase.GUIDToAssetPath(guids[0]); PlayerPrefs.SetString(SETTINGS_PATH_KEY, settingsPath); settings = AssetDatabase.LoadAssetAtPath <BuildManagerSettings>(settingsPath); } } //Cant find settings. Create new if (settings == null) { settings = (BuildManagerSettings)ScriptableObject.CreateInstance(typeof(BuildManagerSettings)); AssetDatabase.CreateAsset(settings, SETTINGS_DEFAULT_PATH); settingsPath = SETTINGS_DEFAULT_PATH; PlayerPrefs.SetString(SETTINGS_PATH_KEY, SETTINGS_DEFAULT_PATH); } sequencesList = new InspectorList <BuildSequence>(); sequencesList.Init(settings.sequences, "Builds sequences", (BuildSequence seq, int i) => seq.editorName); buidsList = new InspectorList <BuildData>(); buidsList.Init(sequencesList.Selected.builds, "Builds", FormBuildNameInList); sequencesList.OnChangeSelectionAction += OnSequenceSelectionChanged; buidsList.OnChangeSelectionAction += OnBuildSelectionChanged; }
public DualInspectorList(SerializedProperty main) { this.main = new InspectorList(main); this.main.onAddCallback += delegate { ReorderableList.defaultBehaviours.DoAddButton(this.main); RefreshSelectedList(); }; this.main.onRemoveCallback += delegate { ReorderableList.defaultBehaviours.DoRemoveButton(this.main); RefreshSelectedList(); }; this.main.onSelectCallback += delegate { RefreshSelectedList(); }; }
protected void doSculptGUI(Vox.VoxelEditor editor) { // brush ghost editor.ghostBrushAlpha = doSliderFloatField("Brush Ghost Opacity", editor.ghostBrushAlpha, 0, 1); editor.gridEnabled = EditorGUILayout.Toggle("Snap to Grid", editor.gridEnabled); if (editor.gridEnabled) { ++EditorGUI.indentLevel; editor.gridUseVoxelUnits = EditorGUILayout.Toggle("Use Voxel Units", editor.gridUseVoxelUnits); if (editor.gridUseVoxelUnits) { float voxelSize = editor.baseSize / (1 << editor.maxDetail); editor.gridSize = EditorGUILayout.FloatField("Grid Spacing (Voxels)", editor.gridSize / voxelSize) * voxelSize; } else { editor.gridSize = EditorGUILayout.FloatField("Grid Spacing (Meters)", editor.gridSize); } --EditorGUI.indentLevel; } // brush list GUILayout.Label("Brush", labelBigFont); editor.selectedBrush = GUILayout.Toolbar(editor.selectedBrush, brushes, GUILayout.MinHeight(20)); // brush substance type string[] substances = new string[editor.voxelSubstances.Length]; for (int i = 0; i < substances.Length; ++i) { substances[i] = editor.voxelSubstances[i].name; } // brush size switch (editor.selectedBrush) { case 0: GUILayout.Label("Hold 'Shift' to subtract."); editor.sphereBrushSize = doSliderFloatField("Sphere Radius (m)", editor.sphereBrushSize, 0, maxBrushSize(editor)); editor.sphereSubstanceOnly = GUILayout.Toggle(editor.sphereSubstanceOnly, "Change Substance Only"); GUILayout.Label("Substance", labelBigFont); editor.sphereBrushSubstance = (byte)GUILayout.SelectionGrid(editor.sphereBrushSubstance, substances, 1); break; case 1: GUILayout.Label("Hold 'Shift' to subtract."); GUILayout.BeginHorizontal(); GUILayout.Label("Dimensions (m)"); editor.cubeBrushDimensions.x = EditorGUILayout.FloatField(editor.cubeBrushDimensions.x); editor.cubeBrushDimensions.y = EditorGUILayout.FloatField(editor.cubeBrushDimensions.y); editor.cubeBrushDimensions.z = EditorGUILayout.FloatField(editor.cubeBrushDimensions.z); GUILayout.EndHorizontal(); editor.cubeSubstanceOnly = GUILayout.Toggle(editor.cubeSubstanceOnly, "Change Substance Only"); GUILayout.Label("Substance", labelBigFont); editor.cubeBrushSubstance = (byte)GUILayout.SelectionGrid(editor.cubeBrushSubstance, substances, 1); break; case 2: editor.smoothBrushSize = doSliderFloatField("Radius (m)", editor.smoothBrushSize, 0, maxBrushSize(editor)); editor.smoothBrushStrength = doSliderFloatField("Strength", editor.smoothBrushStrength, 0, 5); editor.smoothBrushBlurRadius = EditorGUILayout.IntField("Blur Radius", editor.smoothBrushBlurRadius); break; } // PATH GUI if (editor.selectedBrush != 0 && editor.selectedBrush != 1) { return; } GUILayout.Label("Path Tool", labelBigFont); if (editor.pathPoints != null && editor.pathPoints.Length > 0) { GUILayout.Label("Hold 'Control' to place another point."); editor.showPositionHandles = GUILayout.Toggle(editor.showPositionHandles, "Show drag handles (disable click to complete)."); SerializedProperty prop = serializedObject.FindProperty("pathPoints"); InspectorList.doArrayGUISimple(ref prop); serializedObject.ApplyModifiedProperties(); if (GUILayout.Button("Clear Path")) { editor.pathPoints = null; } else if (GUILayout.Button("Apply Path")) { Vox.LocalMutator mut = (Vox.LocalMutator)buildMutator(editor, editor.pathPoints[0]); if (editor.pathPoints.Length > 1) { new Vox.LineMutator(editor.pathPoints, mut).apply(editor); } else { mut.apply(editor); } } } else { GUILayout.Label("Hold 'Control' to start a path."); if (GUILayout.Button("Start Path")) { editor.addPathPoint(editor.transform.position); } } }