public void DrawGraph(InternalTimelineGraphGroupAsset groupAsset, InternalTimelineGraphAsset graphAsset) { GUILayoutExtension.HorizontalGroup(() => { EditorGUILayout.LabelField(graphAsset.name, GUILayout.Width(150)); if (GUILayout.Button("打开", GUILayout.Width(50))) { TimelineWindow.Open(graphAsset); } if (GUILayout.Button("删除", GUILayout.Width(50))) { groupAsset.RemoveGraph(graphAsset); } if (GUILayout.Button("重命名", GUILayout.Width(50))) { MiscHelper.Input($"输入{groupAsset.DisplayName}名:", (string name) => { graphAsset.name = name; EditorUtility.SetDirty(graphAsset); EditorUtility.SetDirty(target); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); }); } }); }
private void OnClickOpenTimeline() { Skill_Node node = Model as Skill_Node; TimelineGroupPath path = TimelineSetting.Setting.GetSearchPath <SkillTimelineGraphGroupAsset>(); SkillTimelineGraphAsset asset = TimelineSetting.Setting.GetAsset <SkillTimelineGraphAsset>(path.searchPath, "timeline_" + node.timeline); if (asset != null) { TimelineWindow.Open(asset); } }
public override void OnInspectorGUI() { base.OnInspectorGUI(); if (!ContextDataCache.TryGetContextData <GUIStyle>("BigLabel", out var bigLabel)) { bigLabel.value = new GUIStyle(GUI.skin.label); bigLabel.value.fontSize = 18; bigLabel.value.fontStyle = FontStyle.Bold; bigLabel.value.alignment = TextAnchor.MiddleLeft; bigLabel.value.stretchWidth = true; } ITimelineGraphAsset graphAsset = target as ITimelineGraphAsset; if (GUILayout.Button("Open", GUILayout.Height(30))) { TimelineWindow.Open(graphAsset); } }