Skip to content
DDevilISL edited this page May 16, 2018 · 4 revisions

Welcome to the ShiroiCutscenes wiki!

ShiroiCutscenes was created with being a simple and easy to use solution to create and edit cutscenes while maintaining the developer's full control over how cutscenes are displayed in mind.

Also, I was extremely bored

Why should I use this instead of Timeline™?

ShiroiCutscenes is meant to be a simple, straightforward solution. I love the new Timeline™ and Playables feature, but sometimes they feel a bit overkill and hard to manage, with this framework, we try to make things simpler and not so complex.

I like to see it as FMod vs Wwise, although Wwise may be more powerful in a sense, it requires a lot more work and knowledge to use it, whereas if you used FMod, you'd be able to produce the same amount of work without actually putting so much effort.

Now into what matters!

How it works

The main concept of this framework are Tokens

Tokens are small actions that can be performed inside a cutscene. A Cutscene is merely a list of tokens that are executed consecutively.

Every Token must extend Token, and by consequence, the method

IEnumerator Execute(CutscenePlayer player);

This is the method that is called when the token is executed. Yes, I know, unbelievable right?

Cutscenes are executed inside a coroutine so anything you would do within a coroutine will behave the same here, so for example, if you want the cutscene to wait until the player has pressed a button you can just

while (!Input.GetButtonDown("Submit")) {
    yield return null;
}

If you have no idea about what I just said means, I recommend you to read about Coroutines

Another example if you still don't get what I mean, this is the WaitForSecondsToken:

using System.Collections;
using JetBrains.Annotations;
using UnityEngine;

namespace Shiroi.Cutscenes.Tokens {
    [UsedImplicitly]
    public class WaitForSecondsToken : Token {
        public float Duration;
        public bool Realtime;

        public override IEnumerator Execute(CutscenePlayer player) {
            if (Realtime) {
                yield return new WaitForSecondsRealtime(Duration);
            } else {
                yield return new WaitForSeconds(Duration);
            }
        }
    }
}