Example #1
0
        public void StartCutscene(CutScene.InGameCutsceneName name)
        {
            Debug.Log("Info: starting " + name + " cutscene.");

            // Subscribe the escape key so the player can escape the cutscene.
            ManagerInput.SubscribeButtonEvent(ManagerInput.ActionsLabels.Cancel, "Cancel", ManagerInput.EventTypeButton.Down, SkipCutscene);

            // Get the cutscene to play
            CutScene currentCutscene = cutscenes[name];

            if (currentCutscene != null)
            {
                // Subscribe to the end of the cutscene
                CutScene.OnCutsceneEnd += WhenCutsceneEnds;

                // Init it
                currentCutscene.Init();

                // Activate it
                Debug.Log("Info: activate " + name + " cutscene.");
                activeCutsceneName = name;
                currentCutscene.Activate();
            }
        }