public void InspectorRoot(TreeData treeData, TreeGroupRoot group) { GUIContent[] contentArray1 = new GUIContent[6]; contentArray1[0] = TreeEditorHelper.GetGUIContent("Distribution|"); contentArray1[1] = TreeEditorHelper.GetGUIContent("Geometry|"); contentArray1[2] = TreeEditorHelper.GetGUIContent("Material|Controls global material properties of the tree."); GUIContent[] names = contentArray1; bool enabled = GUI.enabled; BeginSettingsSection(0, names); this.PrepareSpacing(false); int seed = group.seed; group.seed = this.GUIIntSlider(PropertyType.Normal, treeSeedString, group.seed, 0, 0x98967f, false); if (group.seed != seed) { treeData.UpdateSeed(group.uniqueID); } group.rootSpread = this.GUISlider(PropertyType.Normal, areaSpreadString, group.rootSpread, 0f, 10f, false); group.groundOffset = this.GUISlider(PropertyType.Normal, groundOffsetString, group.groundOffset, 0f, 10f, false); EndSettingsSection(); BeginSettingsSection(1, names); this.PrepareSpacing(false); group.adaptiveLODQuality = this.GUISlider(PropertyType.FullUndo, lodQualityString, group.adaptiveLODQuality, 0f, 1f, false); group.enableAmbientOcclusion = this.GUIToggle(PropertyType.FullUndo, ambientOcclusionString, group.enableAmbientOcclusion, false); GUI.enabled = group.enableAmbientOcclusion; group.aoDensity = this.GUISlider(PropertyType.Normal, aoDensityString, group.aoDensity, 0f, 1f, false); GUI.enabled = true; EndSettingsSection(); Material optimizedCutoutMaterial = treeData.optimizedCutoutMaterial; if (optimizedCutoutMaterial != null) { BeginSettingsSection(2, names); this.PrepareSpacing(false); bool changed = GUI.changed; bool flag3 = this.GUIMaterialColor(optimizedCutoutMaterial, "_TranslucencyColor", translucencyColorString) | this.GUIMaterialSlider(optimizedCutoutMaterial, "_TranslucencyViewDependency", transViewDepString); flag3 |= this.GUIMaterialSlider(optimizedCutoutMaterial, "_Cutoff", alphaCutoffString); flag3 |= this.GUIMaterialSlider(optimizedCutoutMaterial, "_ShadowStrength", shadowStrengthString); if (flag3 | this.GUIMaterialFloatField(optimizedCutoutMaterial, "_ShadowOffsetScale", shadowOffsetString)) { s_CutoutMaterialHashBeforeUndo = GenerateMaterialHash(treeData.optimizedCutoutMaterial); } group.shadowTextureQuality = this.GUIPopup(PropertyType.FullUpdate, shadowCasterResString, leafMaterialOptions, group.shadowTextureQuality, false); GUI.changed = changed; EndSettingsSection(); } GUI.enabled = enabled; EditorGUILayout.Space(); }
public void InspectorRoot(TreeData treeData, TreeGroupRoot group) { GUIContent[] expr_06 = new GUIContent[6]; expr_06[0] = TreeEditorHelper.GetGUIContent("TreeEditor.TreeGroupRoot.Distribution"); expr_06[1] = TreeEditorHelper.GetGUIContent("TreeEditor.TreeGroupRoot.Geometry"); expr_06[2] = TreeEditorHelper.GetGUIContent("TreeEditor.TreeGroupRoot.MaterialProperties"); GUIContent[] names = expr_06; bool enabled = GUI.enabled; TreeEditor.BeginSettingsSection(0, names); this.PrepareSpacing(false); int seed = group.seed; group.seed = this.GUIIntSlider(TreeEditor.PropertyType.Normal, "TreeEditor.TreeGroupRoot.GroupSeed", group.seed, 0, 9999999, false); if (group.seed != seed) { treeData.UpdateSeed(group.uniqueID); } group.rootSpread = this.GUISlider(TreeEditor.PropertyType.Normal, "TreeEditor.TreeGroupRoot.AreaSpread", group.rootSpread, 0f, 10f, false); group.groundOffset = this.GUISlider(TreeEditor.PropertyType.Normal, "TreeEditor.TreeGroupRoot.GroundOffset", group.groundOffset, 0f, 10f, false); TreeEditor.EndSettingsSection(); TreeEditor.BeginSettingsSection(1, names); this.PrepareSpacing(false); group.adaptiveLODQuality = this.GUISlider(TreeEditor.PropertyType.FullUndo, "TreeEditor.TreeGroupRoot.LODQuality", group.adaptiveLODQuality, 0f, 1f, false); group.enableAmbientOcclusion = this.GUIToggle(TreeEditor.PropertyType.FullUndo, "TreeEditor.TreeGroupRoot.AmbientOcclusion", group.enableAmbientOcclusion, false); GUI.enabled = group.enableAmbientOcclusion; group.aoDensity = this.GUISlider(TreeEditor.PropertyType.Normal, "TreeEditor.TreeGroupRoot.AODensity", group.aoDensity, 0f, 1f, false); GUI.enabled = true; TreeEditor.EndSettingsSection(); Material optimizedCutoutMaterial = treeData.optimizedCutoutMaterial; if (optimizedCutoutMaterial != null) { TreeEditor.BeginSettingsSection(2, names); this.PrepareSpacing(false); bool changed = GUI.changed; bool flag = this.GUIMaterialColor(optimizedCutoutMaterial, "_TranslucencyColor", "TreeEditor.TreeGroupRoot.TranslucencyColor"); flag |= this.GUIMaterialSlider(optimizedCutoutMaterial, "_TranslucencyViewDependency", "TreeEditor.TreeGroupRoot.TranslucencyViewDependency"); flag |= this.GUIMaterialSlider(optimizedCutoutMaterial, "_Cutoff", "TreeEditor.TreeGroupRoot.AlphaCutoff"); flag |= this.GUIMaterialSlider(optimizedCutoutMaterial, "_ShadowStrength", "TreeEditor.TreeGroupRoot.ShadowStrength"); flag |= this.GUIMaterialFloatField(optimizedCutoutMaterial, "_ShadowOffsetScale", "TreeEditor.TreeGroupRoot.ShadowOffsetScale"); if (flag) { TreeEditor.s_CutoutMaterialHashBeforeUndo = TreeEditor.GenerateMaterialHash(treeData.optimizedCutoutMaterial); } string[] optionIDs = new string[] { "Full", "Half", "Quarter", "OneEighth", "OneSixteenth" }; group.shadowTextureQuality = this.GUIPopup(TreeEditor.PropertyType.FullUpdate, "TreeEditor.TreeGroupRoot.ShadowTextureQuality", "TreeEditor.TreeGroupRoot.ShadowTextureQualityOption", optionIDs, group.shadowTextureQuality, false); GUI.changed = changed; TreeEditor.EndSettingsSection(); } GUI.enabled = enabled; EditorGUILayout.Space(); }
public void InspectorDistribution(TreeData treeData, TreeGroup group) { if (group != null) { this.PrepareSpacing(true); bool flag = true; if (group.lockFlags != 0) { flag = false; } GUI.enabled = flag; int seed = group.seed; group.seed = this.GUIIntSlider(PropertyType.Normal, group.GroupSeedString, group.seed, 0, 0xf423f, false); if (group.seed != seed) { treeData.UpdateSeed(group.uniqueID); } seed = group.distributionFrequency; group.distributionFrequency = this.GUIIntSlider(PropertyType.FullUndo, group.FrequencyString, group.distributionFrequency, 1, 100, false); if (group.distributionFrequency != seed) { treeData.UpdateFrequency(group.uniqueID); } seed = (int) group.distributionMode; group.distributionMode = (TreeGroup.DistributionMode) this.GUIPopup(PropertyType.Normal, group.DistributionModeString, inspectorDistributionPopupOptions, (int) group.distributionMode, true); if (group.distributionMode != seed) { treeData.UpdateDistribution(group.uniqueID); } AnimationCurve distributionCurve = group.distributionCurve; if (this.GUICurve(PropertyType.Normal, distributionCurve, this.m_CurveRangesA)) { group.distributionCurve = distributionCurve; treeData.UpdateDistribution(group.uniqueID); } if (group.distributionMode != TreeGroup.DistributionMode.Random) { float distributionTwirl = group.distributionTwirl; group.distributionTwirl = this.GUISlider(PropertyType.Normal, group.TwirlString, group.distributionTwirl, -1f, 1f, false); if (group.distributionTwirl != distributionTwirl) { treeData.UpdateDistribution(group.uniqueID); } } if (group.distributionMode == TreeGroup.DistributionMode.Whorled) { seed = group.distributionNodes; group.distributionNodes = this.GUIIntSlider(PropertyType.Normal, group.WhorledStepString, group.distributionNodes, 1, 0x15, false); if (group.distributionNodes != seed) { treeData.UpdateDistribution(group.uniqueID); } } group.distributionScale = this.GUISlider(PropertyType.Normal, group.GrowthScaleString, group.distributionScale, 0f, 1f, true); distributionCurve = group.distributionScaleCurve; if (this.GUICurve(PropertyType.Normal, distributionCurve, this.m_CurveRangesA)) { group.distributionScaleCurve = distributionCurve; } group.distributionPitch = this.GUISlider(PropertyType.Normal, group.GrowthAngleString, group.distributionPitch, 0f, 1f, true); distributionCurve = group.distributionPitchCurve; if (this.GUICurve(PropertyType.Normal, distributionCurve, this.m_CurveRangesB)) { group.distributionPitchCurve = distributionCurve; } GUI.enabled = true; EditorGUILayout.Space(); } }
public void InspectorDistribution(TreeData treeData, TreeGroup group) { if (group == null) { return; } this.PrepareSpacing(true); bool enabled = true; if (group.lockFlags != 0) { enabled = false; } string str = "TreeEditor." + group.GetType().Name + "."; GUI.enabled = enabled; int num = group.seed; group.seed = this.GUIIntSlider(TreeEditor.PropertyType.Normal, str + "GroupSeed", group.seed, 0, 999999, false); if (group.seed != num) { treeData.UpdateSeed(group.uniqueID); } num = group.distributionFrequency; group.distributionFrequency = this.GUIIntSlider(TreeEditor.PropertyType.FullUndo, str + "Frequency", group.distributionFrequency, 1, 100, false); if (group.distributionFrequency != num) { treeData.UpdateFrequency(group.uniqueID); } string[] optionIDs = new string[] { "Random", "Alternate", "Opposite", "Whorled" }; num = (int)group.distributionMode; group.distributionMode = (TreeGroup.DistributionMode)this.GUIPopup(TreeEditor.PropertyType.Normal, str + "DistributionMode", "TreeEditor.DistributionModeOption", optionIDs, (int)group.distributionMode, true); if (group.distributionMode != (TreeGroup.DistributionMode)num) { treeData.UpdateDistribution(group.uniqueID); } AnimationCurve animationCurve = group.distributionCurve; if (this.GUICurve(TreeEditor.PropertyType.Normal, animationCurve, this.m_CurveRangesA)) { group.distributionCurve = animationCurve; treeData.UpdateDistribution(group.uniqueID); } if (group.distributionMode != TreeGroup.DistributionMode.Random) { float distributionTwirl = group.distributionTwirl; group.distributionTwirl = this.GUISlider(TreeEditor.PropertyType.Normal, str + "Twirl", group.distributionTwirl, -1f, 1f, false); if (group.distributionTwirl != distributionTwirl) { treeData.UpdateDistribution(group.uniqueID); } } if (group.distributionMode == TreeGroup.DistributionMode.Whorled) { num = group.distributionNodes; group.distributionNodes = this.GUIIntSlider(TreeEditor.PropertyType.Normal, str + "WhorledStep", group.distributionNodes, 1, 21, false); if (group.distributionNodes != num) { treeData.UpdateDistribution(group.uniqueID); } } group.distributionScale = this.GUISlider(TreeEditor.PropertyType.Normal, str + "GrowthScale", group.distributionScale, 0f, 1f, true); animationCurve = group.distributionScaleCurve; if (this.GUICurve(TreeEditor.PropertyType.Normal, animationCurve, this.m_CurveRangesA)) { group.distributionScaleCurve = animationCurve; } group.distributionPitch = this.GUISlider(TreeEditor.PropertyType.Normal, str + "GrowthAngle", group.distributionPitch, 0f, 1f, true); animationCurve = group.distributionPitchCurve; if (this.GUICurve(TreeEditor.PropertyType.Normal, animationCurve, this.m_CurveRangesB)) { group.distributionPitchCurve = animationCurve; } GUI.enabled = true; EditorGUILayout.Space(); }