How to add onFinish callback to PlayFromSection?

Forums 💬 Slate Sequencer ⚙️ Support How to add onFinish callback to PlayFromSection?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #20113
    mdotstrange
    Participant

      Hello- I don’t know how to use Lambda’s properly and I’m trying to invoke onFinish from PlayFromSection

      I just want to add an option to PlayCutsceneOnStart so it can start from a named section but I also need the onFinish callback(which stops Unity Recorder, great for filmmaking ^_^)

       

      if(SectionNameToPlayFrom != string.Empty)

      {

      cutscene.PlayFromSection((SectionNameToPlayFrom) => { onFinish.Invoke(); });

      }

      else

      {

      cutscene.Play(() => { onFinish.Invoke(); });

      }

      Need some Lambda help- thanks!

      btw- I’ve finished 50 minutes of the film I’m making with Slate so far- Slate is a great filmmaking tool- here’s the second teaser trailer youtube link

      #20115
      Gavalakis
      Keymaster

        Hey, sorry for the late reply. I somehow missed your post :-/

        Here is how to use lambda:

        In case of PlayFromSection method, the existing overload that accepts callback requires to also provide a wrapping method parameter:

        You can alternatively also replace the lambda with a method if that is easier for you. So for example:

        Let me know if that works for you.

        🙂

        #20114
        mdotstrange
        Participant

          [quote quote=2242]Hey, sorry for the late reply. I somehow missed your post :-/ Here is how to use lambda: <!– Crayon Syntax Highlighter v_2.7.2_beta –>

          <!– [Format Time: 0.0009 seconds] –> In case of PlayFromSection method, the existing overload that accepts callback requires to also provide a wrapping method parameter: <!– Crayon Syntax Highlighter v_2.7.2_beta –>

          <!– [Format Time: 0.0002 seconds] –> You can alternatively also replace the lambda with a method if that is easier for you. So for example: <!– Crayon Syntax Highlighter v_2.7.2_beta –>

          <!– [Format Time: 0.0002 seconds] –> Let me know if that works for you. 🙂 [/quote]

          Works perfectly- thank you!

        Viewing 3 posts - 1 through 3 (of 3 total)
        • You must be logged in to reply to this topic.