コード例 #1
0
        protected override void DoWindow(int windowId)
        {
            if (m_TimeLine == null)
            {
                m_TimeLine = new Timeline();
            }

            EditorGUILayout.BeginVertical();

            Rect rect = GUILayoutUtility.GetRect(10f, 32f);

            EditorGUILayout.EndVertical();

            EditorGUI.BeginChangeCheck();

            if (windowRect.width > 32f)
            {
                List <IDopeElement> l_DopeElements = spriteMeshCache.selectedBlendshape.frames.ToList()
                                                     .ConvertAll(f => (IDopeElement)BlendShapeFrameDopeElement.Create(f));

                m_TimeLine.dopeElements = l_DopeElements;
                m_TimeLine.FrameRate    = 1f;
                m_TimeLine.Time         = spriteMeshCache.blendShapeWeight;
                m_TimeLine.DoTimeline(rect);
            }

            if (EditorGUI.EndChangeCheck())
            {
                spriteMeshCache.blendShapeWeight = Mathf.Clamp(m_TimeLine.Time, 0f, 100f);
            }
        }
コード例 #2
0
        public static BlendShapeFrameDopeElement Create(BlendShapeFrame frame)
        {
            BlendShapeFrameDopeElement element = null;

            if (frame)
            {
                element = new BlendShapeFrameDopeElement();

                element.blendShapeFrame = frame;
            }

            return(element);
        }