void OnUpdate()
 {
     try
     {
         var curve = CurveEditorWindowWrapper.GetCurrentAnimationCurve();
         if (curve != null)
         {
             if (!CompareCurves(curve, m_Curve))
             {
                 m_Curve = curve;
                 Repaint();
             }
         }
         if (m_AutoSet)
         {
             var tmp = new List<AnimationCurve>();
             foreach (var P in m_LocalPresets)
             {
                 if (P.active)
                     tmp.Add(P.curve);
             }
             CurveEditorWindowWrapper.Presets = tmp.ToArray();
         }
     }
     catch(Exception e)
     {
         Debug.LogError("CurveEditorTools: Error: " + e.Message);
         Debug.LogWarning("CurveEditorTools: Something went wrong during the Update callback, window closed!");
         Close();
     }
 }
    public static void Init()
    {
        var win = GetWindow<CurveEditorTools>();
        try
        {
            CurveEditorWindowWrapper.GetCurrentCurveEditor();
        }
        catch
        {
            win.Close();
 
        }
    }
    public static void Init()
    {
        var win = GetWindow <CurveEditorTools>();

        try
        {
            CurveEditorWindowWrapper.GetCurrentCurveEditor();
        }
        catch
        {
            Debug.Log("Could not get window");
            //win.Close();
        }
    }
    public static void Init()
    {
        var win = GetWindow <CurveEditorTools>();

        try
        {
            CurveEditorWindowWrapper.GetCurrentCurveEditor();
        }
        catch (Exception e)
        {
            win.Close();
            Debug.Log("error: " + e);
        }
    }
Exemple #5
0
        /// <summary>
        ///     Shows the curve editor window for the given curve.
        /// </summary>
        /// <param name="curve">Curve.</param>
        /// <param name="title">Title.</param>
        /// <param name="color">Color.</param>
        private void EditCurve(AnimationCurve curve, string title, Color color)
        {
            CurveEditorWindowWrapper.ShowCurveEditorWindow(title);
            CurveEditorWindowWrapper.curve = curve;
            CurveEditorWindowWrapper.color = color;

            Rect bounds = NormalCurveRendererWrapper.GetBounds(curve);

            if (HydraMathUtils.Approximately(bounds.height, 0.0f))
            {
                bounds.height = bounds.width;
                bounds.y     -= bounds.height / 2.0f;
            }

            CurveEditorWindowWrapper.Frame(bounds);
        }