Esempio n. 1
0
        public static void WarmUp()
        {
            Logger.Log("Lua Cutscenes", "Warming up cutscenes");

            LuaCutsceneEntity warmupEntity = new LuaCutsceneEntity(null, null, new EntityData());

            warmupEntity.LoadCutscene("Assets/LuaCutscenes/warmup_cutscene", null, null);

            Coroutine beginCoroutine = new Coroutine(warmupEntity.onBeginWrapper(null));

            warmupEntity.OnEnter(null);
            warmupEntity.OnStay(null);
            warmupEntity.OnLeave(null);

            try
            {
                while (!beginCoroutine.Finished)
                {
                    beginCoroutine.Update();
                }
            }
            catch
            {
                // Do nothing
                // The cutscene will crash because the level doesn't exist
            }
        }
Esempio n. 2
0
        public override void OnEnter(Player player)
        {
            cutsceneEntity?.OnEnter(player);

            if (onlyOnce && played)
            {
                return;
            }

            played = true;
            Scene.Add(cutsceneEntity = new LuaCutsceneEntity(this, player, data, unskippable: unskippable));
            cutsceneEntity.OnEnter(player);

            base.OnEnter(player);
        }