コード例 #1
0
        public static void RenderTexture(Rect r, Texture mainTex, Texture mask, Color color, bool flipVertical)
        {
            ClipRenderer.Initialize();
            ClipRenderer.s_Vertices[0] = new Vector3(r.get_xMin(), r.get_yMin(), 0f);
            ClipRenderer.s_Vertices[1] = new Vector3(r.get_xMax(), r.get_yMin(), 0f);
            ClipRenderer.s_Vertices[2] = new Vector3(r.get_xMax(), r.get_yMax(), 0f);
            ClipRenderer.s_Vertices[3] = new Vector3(r.get_xMin(), r.get_yMax(), 0f);
            ClipRenderer.s_Quad.set_vertices(ClipRenderer.s_Vertices);
            float num  = 0f;
            float num2 = 1f;

            if (flipVertical)
            {
                num  = 1f;
                num2 = 0f;
            }
            ClipRenderer.s_UVs[0] = new Vector2(0f, num2);
            ClipRenderer.s_UVs[1] = new Vector2(1f, num2);
            ClipRenderer.s_UVs[2] = new Vector2(1f, num);
            ClipRenderer.s_UVs[3] = new Vector2(0f, num);
            ClipRenderer.s_Quad.set_uv(ClipRenderer.s_UVs);
            ClipRenderer.s_BlendMaterial.SetTexture("_MainTex", mainTex);
            ClipRenderer.s_BlendMaterial.SetTexture("_MaskTex", mask);
            ClipRenderer.s_BlendMaterial.SetColor("_Color", color);
            ClipRenderer.s_BlendMaterial.SetPass(0);
            Graphics.DrawMeshNow(ClipRenderer.s_Quad, Handles.get_matrix());
        }
コード例 #2
0
 public void DrawBlendingCurves(TimelineWindow.TimelineState state)
 {
     if (Event.get_current().get_type() == 7)
     {
         Color color = (!SelectionManager.Contains(this.clip)) ? Color.get_white() : TrackDrawer.GetHighlightColor(Color.get_white());
         Color colorTrackBackground = DirectorStyles.Instance.customSkin.colorTrackBackground;
         Color color2 = (!SelectionManager.Contains(this.clip)) ? DirectorStyles.Instance.customSkin.colorTrackBackground : Color.get_white();
         if (this.blendInKind == TimelineClipGUI.BlendKind.Ease)
         {
             ClipRenderer.RenderTexture(this.mixInRect, DirectorStyles.Instance.timelineClip.get_normal().get_background(), DirectorStyles.Instance.blendingIn.get_normal().get_background(), color, false);
             EditorGUI.DrawRect(new Rect(this.mixInRect.get_xMax() - 2f, this.mixInRect.get_yMin(), 2f, this.mixInRect.get_height()), colorTrackBackground);
             Graphics.DrawAAPolyLine(4f, new Vector3[]
             {
                 new Vector3(this.mixInRect.get_xMin() + 1f, this.mixInRect.get_yMax() - 1f, 0f),
                 new Vector3(this.mixInRect.get_xMax(), this.mixInRect.get_yMin() - 1.5f, 0f)
             }, color2);
         }
         if (this.blendOutKind == TimelineClipGUI.BlendKind.Ease || this.blendOutKind == TimelineClipGUI.BlendKind.Mix)
         {
             ClipRenderer.RenderTexture(this.mixOutRect, DirectorStyles.Instance.timelineClip.get_normal().get_background(), DirectorStyles.Instance.blendingOut.get_normal().get_background(), color, false);
             EditorGUI.DrawRect(new Rect(this.mixOutRect.get_xMin(), this.mixOutRect.get_yMin(), 2f, this.mixOutRect.get_height()), colorTrackBackground);
             Graphics.DrawLineAA(4f, new Vector3(this.mixOutRect.get_xMin() + 1.5f, this.mixOutRect.get_yMin() + 1.5f, 0f), new Vector3(this.mixOutRect.get_xMax(), this.mixOutRect.get_yMax() - 1f, 0f), color2);
         }
         if (this.blendInKind == TimelineClipGUI.BlendKind.Mix)
         {
             ClipRenderer.RenderTexture(this.mixInRect, DirectorStyles.Instance.timelineClip.get_normal().get_background(), DirectorStyles.Instance.blendingOut.get_normal().get_background(), color, false);
             EditorGUI.DrawRect(new Rect(this.mixInRect.get_xMax(), this.mixInRect.get_yMin(), 2f, this.mixOutRect.get_height()), colorTrackBackground);
             Graphics.DrawAAPolyLine(4f, new Vector3[]
             {
                 new Vector3(this.mixInRect.get_xMin(), this.mixInRect.get_yMin(), 0f),
                 new Vector3(this.mixInRect.get_xMax(), this.mixInRect.get_yMax() - 1f, 0f)
             }, color2);
         }
     }
 }
コード例 #3
0
 public static void RenderTexture(Rect r, GUIStyle style, Color color)
 {
     ClipRenderer.Initialize();
     ClipRenderer.s_Vertices[0] = new Vector3(r.get_xMin(), r.get_yMin(), 0f);
     ClipRenderer.s_Vertices[1] = new Vector3(r.get_xMax(), r.get_yMin(), 0f);
     ClipRenderer.s_Vertices[2] = new Vector3(r.get_xMax(), r.get_yMax(), 0f);
     ClipRenderer.s_Vertices[3] = new Vector3(r.get_xMin(), r.get_yMax(), 0f);
     ClipRenderer.s_Quad.set_vertices(ClipRenderer.s_Vertices);
     ClipRenderer.s_UVs[0] = new Vector2(0f, 1f);
     ClipRenderer.s_UVs[1] = new Vector2(1f, 1f);
     ClipRenderer.s_UVs[2] = new Vector2(1f, 0f);
     ClipRenderer.s_UVs[3] = new Vector2(0f, 0f);
     ClipRenderer.s_Quad.set_uv(ClipRenderer.s_UVs);
     ClipRenderer.s_ClipMaterial.SetTexture("_MainTex", style.get_normal().get_background());
     ClipRenderer.s_ClipMaterial.SetColor("_Color", color);
     ClipRenderer.s_ClipMaterial.SetPass(0);
     Graphics.DrawMeshNow(ClipRenderer.s_Quad, Handles.get_matrix());
 }
コード例 #4
0
 public static void RenderClip(Rect r, Color color)
 {
     ClipRenderer.RenderTexture(r, DirectorStyles.Instance.timelineClip, color);
 }