public override void ProcessFrame(Playable playable, FrameData info, object playerData)
    {
        Plugin = playerData as Plugin4DS;

        if (onstart)
        {
            if (Plugin == null)
            {
                return;
            }

            double duration = playable.GetDuration() * Plugin.Framerate;
            double newSpeed = 1;

            if (firstFrame < lastFrame && firstFrame >= 0)
            {
                newSpeed = (lastFrame - firstFrame) / duration;
                //Debug.Log("new speed : " + newSpeed);
            }
            else
            {
                newSpeed = (Plugin.SequenceNbOfFrames - firstFrame) / duration;
                //Debug.Log("new speed : " + newSpeed);
            }

            Plugin.SpeedRatio = (float)newSpeed;
            Plugin.GotoFrame(firstFrame);
            Plugin.Play(true);

            onstart = false;
        }

        base.ProcessFrame(playable, info, playerData);
    }
    public void onClick()
    {
        if (_unit == 0)
        {
            return;
        }

        //todo: manage mobile touch instead of mouse;
        int clickedFrame;

        if (Input.touchCount == 1)
        {
            Touch touch = Input.GetTouch(0);
            clickedFrame = (int)(touch.position.x / _unit);
        }
        else
        {
            clickedFrame = (int)(Input.mousePosition.x / _unit);
        }

        _plugin4DS.GotoFrame(clickedFrame);
    }