Пример #1
0
        /**
         * <summary>Runs the ActionListAsset defined in SettingsManager's actionListOnStart when the game begins.</summary>
         * <returns>True if an ActionListAsset was run</returns>
         */
        public bool PlayGlobalOnStart()
        {
            if (runAtLeastOnce)
            {
                return(false);
            }

            runAtLeastOnce = true;

            ActiveInput.Upgrade();
            if (KickStarter.settingsManager.activeInputs != null)
            {
                foreach (ActiveInput activeInput in KickStarter.settingsManager.activeInputs)
                {
                    activeInput.SetDefaultState();
                }
            }

            if (gameState != GameState.Paused)
            {
                // Fix for audio pausing on start
                AudioListener.pause = false;
            }

            if (KickStarter.settingsManager.actionListOnStart)
            {
                AdvGame.RunActionListAsset(KickStarter.settingsManager.actionListOnStart);
                return(true);
            }

            return(false);
        }
Пример #2
0
        private void OnGUI()
        {
            if (settingsManager == null)
            {
                EditorGUILayout.HelpBox("A Settings Manager must be assigned before this window can display correctly.", MessageType.Warning);
                return;
            }

            ActiveInput.Upgrade();
            ShowActiveInputsGUI();

            UnityVersionHandler.CustomSetDirty(settingsManager);
        }
        override public void ShowGUI(List <ActionParameter> parameters)
        {
            int tempNumber = -1;

            if (KickStarter.settingsManager != null && KickStarter.settingsManager.activeInputs != null && KickStarter.settingsManager.activeInputs.Count > 0)
            {
                ActiveInput.Upgrade();

                string[] labelList = new string[KickStarter.settingsManager.activeInputs.Count];
                for (int i = 0; i < KickStarter.settingsManager.activeInputs.Count; i++)
                {
                    labelList[i] = i.ToString() + ": " + KickStarter.settingsManager.activeInputs[i].inputName;

                    if (KickStarter.settingsManager.activeInputs[i].ID == activeInputID)
                    {
                        tempNumber = i;
                    }
                }

                if (tempNumber == -1)
                {
                    // Wasn't found (was deleted?), so revert to zero
                    if (activeInputID != 0)
                    {
                        ACDebug.LogWarning("Previously chosen active input no longer exists!");
                    }
                    tempNumber    = 0;
                    activeInputID = 0;
                }

                tempNumber    = EditorGUILayout.Popup("Active input:", tempNumber, labelList);
                activeInputID = KickStarter.settingsManager.activeInputs [tempNumber].ID;
                newState      = EditorGUILayout.Toggle("New state:", newState);
            }
            else
            {
                EditorGUILayout.HelpBox("No active inputs exist! They can be defined in Adventure Creator -> Editors -> Active Inputs.", MessageType.Info);
                activeInputID = 0;
                tempNumber    = 0;
            }

            AfterRunningOption();
        }