protected void BeginProperties(bool showColor = true) { soRnd.Update(); using (ShapesUI.Horizontal) { using (ShapesUI.TempFieldWidth(180f)) ShapesUI.RenderSortingLayerField(propSortingLayer); using (ShapesUI.TempLabelWidth(40f)) EditorGUILayout.PropertyField(propSortingOrder, new GUIContent("Order")); } EditorGUILayout.PropertyField(propBlendMode, blendModeGuiContent); if ((target as ShapeRenderer).HasScaleModes) { EditorGUILayout.PropertyField(propScaleMode, scaleModeGuiContent); } if (showColor) { PropertyFieldColor(); } }
protected void BeginProperties(bool showColor = true) { soRnd.Update(); ShapesUI.BeginGroup(); using (ShapesUI.Horizontal) { using (ShapesUI.TempFieldWidth(180f)) ShapesUI.RenderSortingLayerField(propSortingLayer); using (ShapesUI.TempLabelWidth(40f)) EditorGUILayout.PropertyField(propSortingOrder, new GUIContent("Order")); } EditorGUILayout.PropertyField(propZTest, zTestGuiContent); EditorGUILayout.PropertyField(propZOffsetFactor, zOffsetFactorGuiContent); EditorGUILayout.PropertyField(propZOffsetUnits, zOffsetUnitsGuiContent); // todo: add little warning box about instancing int uniqueCount = 0; int instancedCount = 0; foreach (ShapeRenderer obj in targets.Cast <ShapeRenderer>()) { if (obj.IsUsingUniqueMaterials) { uniqueCount++; } else { instancedCount++; } } if (uniqueCount > 0) { string label; if (instancedCount == 0) { if (uniqueCount == 1) // single non-instanced { label = "Note: this object is not GPU instanced due to custom depth settings"; } else // multiple exclusively non-instanced { label = "Note: these objects are not GPU instanced due to custom depth settings"; } } else // mixed selection { label = "Note: some of these objects are not GPU instanced due to custom depth settings"; } GUIStyle wrapLabel = new GUIStyle(EditorStyles.miniLabel); wrapLabel.wordWrap = true; using (ShapesUI.Horizontal) { GUIContent icon = EditorGUIUtility.IconContent("console.warnicon.sml"); GUILayout.Label(icon); GUILayout.TextArea(label, wrapLabel); } } ShapesUI.EndGroup(); EditorGUILayout.PropertyField(propBlendMode, blendModeGuiContent); if ((target as ShapeRenderer).HasScaleModes) { EditorGUILayout.PropertyField(propScaleMode, scaleModeGuiContent); } if (showColor) { PropertyFieldColor(); } }