public void OnGUI(Rect rect) { if (m_EndStageData == null) { EditorGUI.HelpBox(rect, "Data is Null", MessageType.Error); return; } float deltaHeight = 0.0f; Rect isScaleTimeRect = new Rect(rect.x, rect.y + deltaHeight, rect.width, EditorGUIUtility.singleLineHeight); m_EndStageData.IsScaleByTime = EditorGUI.Toggle(isScaleTimeRect, "Is Scale By Time", m_EndStageData.IsScaleByTime); deltaHeight += isScaleTimeRect.height; Rect groupRect = new Rect(rect.x, rect.y + deltaHeight, rect.width, (rect.height - deltaHeight) * .6f); EditorGUIUtil.DrawAreaLine(groupRect, Color.gray); groupDrawer.OnGUI(groupRect); deltaHeight += groupRect.height; Rect breakGroupRect = new Rect(rect.x, rect.y + deltaHeight, rect.width, rect.height - deltaHeight); EditorGUIUtil.DrawAreaLine(breakGroupRect, Color.gray); breakGroupDrawer.OnGUI(breakGroupRect); }
public void OnGUI(Rect rect) { if (m_FlyingStageData == null) { EditorGUI.HelpBox(rect, "Data is Null", MessageType.Error); return; } EditorGUIUtil.DrawAreaLine(rect, Color.gray); groupDrawer.OnGUI(rect); }
private void DrawGroup(Rect rect) { if (m_ReleaseStageData.Childs.Count == 0) { EditorGUI.LabelField(rect, "Child Data is Empty.Add a new child by btn(new)"); return; } SkillReleaseChildData childData = m_ReleaseStageData.Childs[SelectedChildIndex]; float deltaHeight = 0.0f; Rect fieldRect = new Rect(rect.x, rect.y + deltaHeight, rect.width, EditorGUIUtility.singleLineHeight); childData.ConditionType = (SkillReleaseStageCondtionType)EditorGUI.EnumPopup(fieldRect, "ConditionType", childData.ConditionType); SkillReleaseTimeLengthCondition condition = childData.TimeLengthCondition; fieldRect.y += fieldRect.height; EditorGUI.LabelField(fieldRect, "TimeLengthCondition"); fieldRect.y += fieldRect.height; Rect conditionRect = fieldRect; conditionRect.x += 12; condition.MinTime = EditorGUI.FloatField(conditionRect, "MinTime", condition.MinTime); conditionRect.y += conditionRect.height; condition.MaxTime = EditorGUI.FloatField(conditionRect, "MaxTime", condition.MaxTime); deltaHeight += EditorGUIUtility.singleLineHeight * 4; Rect groupRect = new Rect(rect.x, rect.y + deltaHeight, rect.width, (rect.height - deltaHeight) * .6f); EditorGUIUtil.DrawAreaLine(groupRect, Color.gray); groupDrawer.OnGUI(groupRect); deltaHeight += groupRect.height; Rect breakGroupRect = new Rect(rect.x, rect.y + deltaHeight, rect.width, rect.height - deltaHeight); EditorGUIUtil.DrawAreaLine(breakGroupRect, Color.gray); breakGroupDrawer.OnGUI(breakGroupRect); }
public void OnGUI(Rect rect) { if (m_BeginStageData == null) { EditorGUI.HelpBox(rect, "Data is Null", MessageType.Error); return; } float deltaHeight = 0.0f; Rect isScaleTimeRect = new Rect(rect.x, rect.y + deltaHeight, rect.width, EditorGUIUtility.singleLineHeight); m_BeginStageData.IsScaleByTime = EditorGUI.Toggle(isScaleTimeRect, "Is Scale By Time", m_BeginStageData.IsScaleByTime); deltaHeight += isScaleTimeRect.height; //进度条 Rect ProgressBarRect = new Rect(isScaleTimeRect.x, isScaleTimeRect.y + isScaleTimeRect.height, isScaleTimeRect.width, EditorGUIUtility.singleLineHeight * 3); GUI.BeginGroup(ProgressBarRect); Rect PbRect = new Rect(0, 0, ProgressBarRect.width, EditorGUIUtility.singleLineHeight); EditorGUI.LabelField(PbRect, "进度条信息:"); PbRect.x += 20; PbRect.y += EditorGUIUtility.singleLineHeight; m_BeginStageData.ProgressBarData.IsShow = EditorGUI.Toggle(PbRect, "是否显示", m_BeginStageData.ProgressBarData.IsShow); PbRect.y += EditorGUIUtility.singleLineHeight; m_BeginStageData.ProgressBarData.StyleIndex = EditorGUI.IntField(PbRect, "样式索引", m_BeginStageData.ProgressBarData.StyleIndex); GUI.EndGroup(); deltaHeight += ProgressBarRect.height; Rect groupRect = new Rect(rect.x, rect.y + deltaHeight, rect.width, (rect.height - deltaHeight) * .6f); EditorGUIUtil.DrawAreaLine(groupRect, Color.gray); groupDrawer.OnGUI(groupRect); deltaHeight += groupRect.height; Rect breakGroupRect = new Rect(rect.x, rect.y + deltaHeight, rect.width, rect.height - deltaHeight); EditorGUIUtil.DrawAreaLine(breakGroupRect, Color.gray); breakGroupDrawer.OnGUI(breakGroupRect); }