コード例 #1
0
            /// <summary>
            /// Returns a disposable <see cref="TransitionContext"/> representing the specified parameters.
            /// <para></para>
            /// Note that the same instance is returned every time and it can be accessed via <see cref="Context"/>.
            /// </summary>
            public static IDisposable Get(TransitionDrawer drawer, SerializedProperty transitionProperty)
            {
                Debug.Assert(Context == null,
                             "Cannot get a new context before the previous one is disposed.");

                Instance.Property        = transitionProperty;
                Instance.Transition      = transitionProperty.GetValue <ITransitionDetailed>();
                Instance.MaximumDuration = Instance.Transition != null ? Instance.Transition.MaximumDuration : 0;

                EditorGUI.BeginChangeCheck();

                return(Context = Instance);
            }