public override void OnGUI(AnimationEventEditorWindowInfo editorWindowInfo) { base.OnGUI(editorWindowInfo); GUIContent firstKeyContent = EditorGUIUtility.TrIconContent("Animation.FirstKey", "Go to the beginning of the animation clip."); if (GUILayout.Button(firstKeyContent, EditorStyles.toolbarButton, GUILayout.Width(BUTTON_WIDTH))) { // 初回のキーに戻る } GUIContent prevKeyContent = EditorGUIUtility.TrIconContent("Animation.PrevKey", "Go to previous keyframe."); if (GUILayout.Button(prevKeyContent, EditorStyles.toolbarButton, GUILayout.Width(BUTTON_WIDTH))) { // 一つ前のキーに戻る } using (new EditorGUI.DisabledScope(EditorWindowInfo.Selector.DisablePlay())) { // 再生ボタン PlayButtonOnGUI(); } GUIContent nextKeyContent = EditorGUIUtility.TrIconContent("Animation.NextKey", "Go to next keyframe."); if (GUILayout.Button(nextKeyContent, EditorStyles.toolbarButton, GUILayout.Width(BUTTON_WIDTH))) { // 一つ次のキーへ } GUIContent lastKeyContent = EditorGUIUtility.TrIconContent("Animation.LastKey", "Go to the end of the animation clip."); if (GUILayout.Button(lastKeyContent, EditorStyles.toolbarButton, GUILayout.Width(BUTTON_WIDTH))) { // 最後のキーへ } const float textWidth = 100.0f; if (EditorWindowInfo.Selector.NotSelectedAnimationEvents) { EditorWindowInfo.IsPlaying = false; GUILayout.Label("not selected", EditorStyles.miniLabel, GUILayout.MaxWidth(textWidth)); } else { GUILayout.Label(EditorWindowInfo.Selector.AnimationEvents.name, EditorStyles.miniLabel, GUILayout.MaxWidth(textWidth)); } const float sliderWidth = 50.0f; _sliderValue = GUILayout.HorizontalSlider(_sliderValue, 0.0f, 2.0f, GUILayout.MaxWidth(sliderWidth)); EditorWindowInfo.Selector.Animator.SetSpeed(_sliderValue); }
public override void OnGUI(AnimationEventEditorWindowInfo editorWindowInfo) { base.OnGUI(editorWindowInfo); if (EditorWindowInfo.Selector.NotSelectedAnimationEvents) { return; } DrawAnimationClips(); DrawAddAnimationClip(); }
public override void OnGUI(AnimationEventEditorWindowInfo editorWindowInfo) { base.OnGUI(editorWindowInfo); _editorWindowInfo = editorWindowInfo; _scrollPos = EditorGUILayout.BeginScrollView(_scrollPos); Rect timeAreaRect = GUILayoutUtility.GetRect(0, 0); DrawTimeAreaBackground(timeAreaRect); DrawTimeArea(timeAreaRect, _editorWindowInfo.Position.height); EditorGUILayout.EndScrollView(); RemoveAnimationEventObject(); }