UpdateFrequency() public method

public UpdateFrequency ( int id ) : void
id int
return void
示例#1
0
 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();
     }
 }
示例#2
0
		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();
		}