Chapters
Workflow
Chapters are entirely managed by the ‘Chapter Manager’ component, which is attached to the Main Content > Story Mode object in the demo scene. Here you can add new chapters and modify existing items. If you need to localize the content, you can fill in the key parameters.
There are four types of chapter states.
- Locked: Can’t be played, not unlocked yet.
- Unlocked: Can be played, not yet completed.
- Completed: Can be re-played, completed.
- Current: Can be played, not completed but started.
Scripting
using UnityEngine;
using Michsky.UI.Beam; // Namespace
public class SampleClass : MonoBehaviour
{
[SerializeField] private ChapterManager chapterManager;
void Start()
{
// Re-initialize chapters
chapterManager.InitializeChapters();
// Change chapter page
chapterManager.NextChapter();
chapterManager.PrevChapter();
// Set chapter states
// No reference required for this call as it's static
ChapterManager.SetLocked("ChapterID");
ChapterManager.SetUnlocked("ChapterID");
ChapterManager.SetCurrent("ChapterID");
ChapterManager.SetCompleted("ChapterID");
}
}
How can we help?
A premium WordPress theme with an integrated Knowledge Base,
providing 24/7 community-based support.