-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathToken.cs
34 lines (32 loc) · 1.59 KB
/
Token.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System.Collections;
using UnityEngine;
namespace Shiroi.Cutscenes.Tokens {
/// <summary>
/// A token represents a small action that happens inside a <see cref="Cutscene"/>.
/// <br/>
/// It extends from <see cref="UnityEngine.ScriptableObject"/>, so serialization behaves as specified by
/// <a href="https://blogs.unity3d.com/pt/2012/10/25/unity-serialization/">this article</a>.
/// </summary>
public abstract class Token : ScriptableObject {
/// <summary>
/// The method called when the token is supposed to execute whatever it's action is supposed to do.
/// This is run inside a coroutine, meanly whatever is execute will behave exactly like one.
/// <br/>
/// <a href="https://docs.unity3d.com/Manual/Coroutines.html">Click here for an article about coroutines</a>
/// </summary>
/// <param name="player">The <see cref="CutscenePlayer"/> that the cutscene is being executed in.</param>
/// <param name="executor"></param>
/// <returns>The enumerator that is executed by the <see cref="player"/> inside a coroutine.</returns>
public abstract IEnumerator Execute(CutscenePlayer player, CutsceneExecutor executor);
}
/// <summary>
/// Represents a <see cref="Token"/> that can react to changes made to itself by the inspector.
/// </summary>
public interface ITokenChangedListener {
/// <summary>
/// Called when a token is changed in the inspector
/// </summary>
/// <param name="cutscene"></param>
void OnChanged(Cutscene cutscene);
}
}