Exemplo n.º 1
0
        public void EndList(ActionList _list)
        {
            if (IsListRunning(_list))
            {
                activeLists.Remove(_list);
            }

            _list.Reset();

            if (_list.conversation == conversationOnEnd && _list.conversation != null)
            {
                if (KickStarter.stateHandler)
                {
                    KickStarter.stateHandler.gameState = GameState.Cutscene;
                }
                else
                {
                    Debug.LogWarning("Could not set correct GameState!");
                }

                ResetSkipVars();
                conversationOnEnd.Interact();
                conversationOnEnd = null;
            }
            else
            {
                if (_list is RuntimeActionList && _list.actionListType == ActionListType.PauseGameplay && !_list.unfreezePauseMenus && KickStarter.playerMenus.ArePauseMenusOn(null))
                {
                    // Don't affect the gamestate if we want to remain frozen
                    if (KickStarter.stateHandler.gameState != GameState.Cutscene)
                    {
                        ResetSkipVars();
                    }
                }
                else
                {
                    SetCorrectGameStateEnd();
                }
            }

            if (_list.autosaveAfter)
            {
                if (!IsGameplayBlocked())
                {
                    SaveSystem.SaveAutoSave();
                }
                else
                {
                    saveAfterCutscene = true;
                }
            }

            if (_list is RuntimeActionList)
            {
                RuntimeActionList runtimeActionList = (RuntimeActionList)_list;
                runtimeActionList.DestroySelf();
            }
        }
Exemplo n.º 2
0
        /**
         * Ends all currently-running ActionLists and ActionListAssets.
         */
        public void KillAllLists()
        {
            foreach (ActionList _list in activeLists)
            {
                _list.ResetList();

                if (_list is RuntimeActionList)
                {
                    RuntimeActionList runtimeActionList = (RuntimeActionList)_list;
                    runtimeActionList.DestroySelf();
                }
            }

            activeLists.Clear();
        }
Exemplo n.º 3
0
        /**
         * <summary>Resets the associated ActionList.</summary>
         * <param name = "removeFromSkipQueue">If True, then the associated ActionList will not be run when 'EndCutscene' is triggered</param>
         */
        public void Reset(bool removeFromSkipQueue)
        {
            isRunning = false;

            if (actionList != null)
            {
                actionList.ResetList();
                if (actionList is RuntimeActionList)
                {
                    RuntimeActionList runtimeActionList = (RuntimeActionList)actionList;
                    runtimeActionList.DestroySelf();
                }
            }

            if (removeFromSkipQueue)
            {
                inSkipQueue = false;
            }
        }