예제 #1
0
    void OnSliderChange()
    {
        float val = UISlider.current.value;

        //If the slider is different than the editor's data, we need to update the model
        if (editor.currentFrame != val)
        {
            ChangeCurrentFrame legacyAction = ScriptableObject.CreateInstance <ChangeCurrentFrame>();
            legacyAction.init(Mathf.FloorToInt(Mathf.Lerp(0, slider.numberOfSteps - 1, slider.value)), false, false);
            editor.DoAction(legacyAction);
        }
    }
예제 #2
0
    public void OnAction()
    {
        ChangeCurrentFrame legacyAction = ScriptableObject.CreateInstance <ChangeCurrentFrame>();

        switch (buttonType)
        {
        case TimelineButtonType.FIRST:
            legacyAction.init(0, false, false);
            break;

        case TimelineButtonType.PREVIOUS:
            legacyAction.init(-1, true, false);
            break;

        case TimelineButtonType.NEXT:
            legacyAction.init(1, true, false);
            break;

        case TimelineButtonType.LAST:
            legacyAction.init(9999, false, true);
            break;
        }
        LegacyEditorData.instance.DoAction(legacyAction);
    }