Пример #1
0
    void CinemaCurveControl_TranslateCurveClipItem(object sender, CurveClipItemEventArgs e)
    {
        CinemaClipCurve curveClip = e.curveClipItem as CinemaClipCurve;

        if (curveClip == null)
        {
            return;
        }

        Undo.RecordObject(e.curveClipItem, string.Format("Changed {0}", curveClip.name));
        curveClip.TranslateCurves(e.firetime - curveClip.Firetime);
    }
Пример #2
0
    private void pasteItem(object userData)
    {
        PasteContext data = userData as PasteContext;

        if (data != null)
        {
            float      firetime = (data.mousePosition.x - state.Translation.x) / state.Scale.x;
            GameObject clone    = DirectorCopyPaste.Paste(data.track.transform);

            CinemaClipCurve clipCurve = clone.GetComponent <CinemaClipCurve>();
            clipCurve.TranslateCurves(firetime - clipCurve.Firetime);

            Undo.RegisterCreatedObjectUndo(clone, "Pasted " + clone.name);
        }
    }