Ejemplo n.º 1
0
        public override void OnBuildTrackContextMenu(GenericMenu menu, TrackAsset track, ITimelineState state)
        {
            base.OnBuildTrackContextMenu(menu, track, state);
            bool           flag      = false;
            AnimationTrack animTrack = track as AnimationTrack;

            if (animTrack != null)
            {
                if (animTrack.CanConvertFromClipMode() || animTrack.CanConvertToClipMode())
                {
                    bool flag2 = animTrack.CanConvertFromClipMode();
                    bool flag3 = animTrack.CanConvertToClipMode();
                    if (flag2)
                    {
                        menu.AddItem(EditorGUIUtility.TextContent("Convert To Infinite Clip"), false, delegate(object parentTrack)
                        {
                            animTrack.ConvertFromClipMode(state.timeline);
                        }, track);
                        flag = true;
                    }
                    if (flag3)
                    {
                        menu.AddItem(EditorGUIUtility.TextContent("Convert To Clip Track"), false, delegate(object parentTrack)
                        {
                            animTrack.ConvertToClipMode();
                            state.Refresh();
                        }, track);
                    }
                }
            }
            if (!track.isSubTrack)
            {
                if (flag)
                {
                    menu.AddSeparator("");
                }
                menu.AddItem(EditorGUIUtility.TextContent("Add Override Track"), false, delegate(object parentTrack)
                {
                    AnimationTrackDrawer.AddSubTrack(state, typeof(AnimationTrack), "Override " + track.subTracks.Count.ToString(), track);
                }, track);
            }
        }