当前位置: 首页>>代码示例>>C#>>正文


C# AC.TurnOff方法代码示例

本文整理汇总了C#中AC.TurnOff方法的典型用法代码示例。如果您正苦于以下问题:C# AC.TurnOff方法的具体用法?C# AC.TurnOff怎么用?C# AC.TurnOff使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AC的用法示例。


在下文中一共展示了AC.TurnOff方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UpdateMenu

        private void UpdateMenu(AC.Menu menu)
        {
            Vector2 invertedMouse = KickStarter.playerInput.GetInvertedMouse ();
            UpdateMenuPosition (menu, invertedMouse);

            menu.HandleTransition ();

            if (KickStarter.settingsManager.inputMethod == InputMethod.KeyboardOrController && menu.IsEnabled ())
            {
                KickStarter.playerInput.InputControlMenu (menu);
            }

            if (menu.appearType == AppearType.Manual)
            {
                if (menu.IsVisible () && !menu.isLocked && menu.IsPointInside (invertedMouse) && !menu.ignoreMouseClicks)
                {
                    foundMouseOverMenu = true;
                }
            }

            else if (menu.appearType == AppearType.DuringGameplay)
            {
                if (KickStarter.stateHandler.gameState == GameState.Normal && !menu.isLocked)
                {
                    if (menu.IsOff ())
                    {
                        menu.TurnOn (true);
                    }

                    if (menu.IsOn () && menu.IsPointInside (invertedMouse))
                    {
                        foundMouseOverMenu = true;
                    }
                }
                else if (KickStarter.stateHandler.gameState == GameState.Paused)
                {
                    menu.TurnOff (true);
                }
                //else if (KickStarter.stateHandler.gameState != GameState.Normal && menu.IsOn () && (KickStarter.actionListManager.AreActionListsRunning () || KickStarter.playerInput.activeConversation != null))
                else if (menu.IsOn () && KickStarter.actionListManager.IsGameplayBlocked ())
                {
                    menu.TurnOff (true);
                }
            }

            else if (menu.appearType == AppearType.MouseOver)
            {
                if (KickStarter.stateHandler.gameState == GameState.Normal && !menu.isLocked && menu.IsPointInside (invertedMouse))
                {
                    if (menu.IsOff ())
                    {
                        menu.TurnOn (true);
                    }

                    if (!menu.ignoreMouseClicks)
                    {
                        foundMouseOverMenu = true;
                    }
                }
                else if (KickStarter.stateHandler.gameState == GameState.Paused)
                {
                    menu.ForceOff ();
                }
                else
                {
                    menu.TurnOff (true);
                }
            }

            else if (menu.appearType == AppearType.OnContainer)
            {
                if (KickStarter.playerInput.activeContainer != null && !menu.isLocked && (KickStarter.stateHandler.gameState == GameState.Normal || (KickStarter.stateHandler.gameState == AC.GameState.Paused && menu.pauseWhenEnabled)))
                {
                    if (menu.IsVisible () && menu.IsPointInside (invertedMouse) && !menu.ignoreMouseClicks)
                    {
                        foundMouseOverMenu = true;
                    }
                    menu.TurnOn (true);
                }
                else
                {
                    menu.TurnOff (true);
                }
            }

            else if (menu.appearType == AppearType.DuringConversation)
            {
                if (KickStarter.playerInput.activeConversation != null && KickStarter.stateHandler.gameState == GameState.DialogOptions)
                {
                    menu.TurnOn (true);
                }
                else if (KickStarter.stateHandler.gameState == GameState.Paused)
                {
                    menu.ForceOff ();
                }
                else
                {
                    menu.TurnOff (true);
                }
            }
//.........这里部分代码省略.........
开发者ID:Davetheallthing,项目名称:Space-Walk,代码行数:101,代码来源:PlayerMenus.cs

示例2: ProcessClick

        public override void ProcessClick(AC.Menu _menu, int _slot, MouseState _mouseState)
        {
            if (KickStarter.stateHandler.gameState == GameState.Cutscene)
            {
                return;
            }

            base.ProcessClick (_menu, _slot, _mouseState);

            ShowClick ();

            if (buttonClickType == AC_ButtonClickType.TurnOffMenu)
            {
                _menu.TurnOff (doFade);
            }
            else if (buttonClickType == AC_ButtonClickType.Crossfade)
            {
                AC.Menu menuToSwitchTo = PlayerMenus.GetMenuWithName (switchMenuTitle);

                if (menuToSwitchTo != null)
                {
                    KickStarter.playerMenus.CrossFade (menuToSwitchTo);
                }
                else
                {
                    Debug.LogWarning ("Cannot find any menu of name '" + switchMenuTitle + "'");
                }
            }
            else if (buttonClickType == AC_ButtonClickType.OffsetElementSlot)
            {
                if (elementToShift == null)
                {
                    elementToShift = PlayerMenus.GetElementWithName (_menu.title, inventoryBoxTitle);
                }
                if (elementToShift != null)
                {
                    elementToShift.Shift (shiftInventory, shiftAmount);
                    elementToShift.RecalculateSize (_menu.menuSource);
                }
                else
                {
                    Debug.LogWarning ("Cannot find '" + inventoryBoxTitle + "' inside '" + _menu.title + "'");
                }
            }
            else if (buttonClickType == AC_ButtonClickType.OffsetJournal)
            {
                MenuJournal journalToShift = (MenuJournal) PlayerMenus.GetElementWithName (_menu.title, inventoryBoxTitle);

                if (journalToShift != null)
                {
                    journalToShift.Shift (shiftInventory, loopJournal);
                    journalToShift.RecalculateSize (_menu.menuSource);
                }
                else
                {
                    Debug.LogWarning ("Cannot find '" + inventoryBoxTitle + "' inside '" + _menu.title + "'");
                }
            }
            else if (buttonClickType == AC_ButtonClickType.RunActionList)
            {
                if (actionList)
                {
                    AdvGame.RunActionListAsset (actionList, parameterID, parameterValue);
                }
            }
            else if (buttonClickType == AC_ButtonClickType.CustomScript)
            {
                MenuSystem.OnElementClick (_menu, this, _slot, (int) _mouseState);
            }
            else if (buttonClickType == AC_ButtonClickType.SimulateInput)
            {
                KickStarter.playerInput.SimulateInput (simulateInput, inputAxis, simulateValue);
            }
        }
开发者ID:IJkeB,项目名称:Ekster_Final,代码行数:74,代码来源:MenuButton.cs

示例3: ProcessClick

        public override void ProcessClick(AC.Menu _menu, int _slot, MouseState _mouseState)
        {
            if (KickStarter.stateHandler.gameState == GameState.Cutscene)
            {
                return;
            }

            base.ProcessClick (_menu, _slot, _mouseState);

            bool isSuccess = true;
            if (saveListType == AC_SaveListType.Save && autoHandle)
            {
                if (newSaveSlot && _slot == (numSlots - 1))
                {
                    isSuccess = SaveSystem.SaveNewGame ();

                    if (KickStarter.settingsManager.orderSavesByUpdateTime)
                    {
                        offset = 0;
                    }
                    else
                    {
                        Shift (AC_ShiftInventory.ShiftRight, 1);
                    }
                }
                else
                {
                    isSuccess = SaveSystem.SaveGame (_slot + offset, optionToShow, fixedOption);
                }
            }
            else if (saveListType == AC_SaveListType.Load && autoHandle)
            {
                isSuccess = SaveSystem.LoadGame (_slot + offset, optionToShow, fixedOption);
            }
            else if (saveListType == AC_SaveListType.Import)
            {
                isSuccess = SaveSystem.ImportGame (_slot + offset, optionToShow, fixedOption);
            }

            if (isSuccess)
            {
                if (saveListType == AC_SaveListType.Save)
                {
                    _menu.TurnOff (true);
                }
                else if (saveListType == AC_SaveListType.Load)
                {
                    _menu.TurnOff (false);
                }

                AdvGame.RunActionListAsset (actionListOnSave, parameterID, _slot);
            }
            else if (!autoHandle && saveListType != AC_SaveListType.Import)
            {
                AdvGame.RunActionListAsset (actionListOnSave, parameterID, _slot);
            }
        }
开发者ID:IJkeB,项目名称:Ekster_Final,代码行数:57,代码来源:MenuSavesList.cs

示例4: ProcessInventoryBoxClick

        /**
         * <summary>Processes the clicking of an inventory item within a MenuInventoryBox element</summary>
         * <param name = "_menu">The Menu that contains the MenuInventoryBox element</param>
         * <param name = "inventoryBox">The MenuInventoryBox element that was clicked on</param>
         * <param name = "_slot">The index number of the MenuInventoryBox slot that was clicked on</param>
         * <param name = "_mouseState">The state of the mouse when the click occured (Normal, SingleClick, RightClick, DoubleClick, HeldDown, LetGo)</param>
         */
        public void ProcessInventoryBoxClick(AC.Menu _menu, MenuInventoryBox inventoryBox, int _slot, MouseState _mouseState)
        {
            if (inventoryBox.inventoryBoxType == AC_InventoryBoxType.Default || inventoryBox.inventoryBoxType == AC_InventoryBoxType.DisplayLastSelected)
            {
                if (KickStarter.settingsManager.inventoryInteractions == InventoryInteractions.Multiple && KickStarter.playerMenus.IsInteractionMenuOn ())
                {
                    KickStarter.playerMenus.SetInteractionMenus (false);
                    ClickInvItemToInteract ();
                }
                else if (KickStarter.settingsManager.inventoryInteractions == InventoryInteractions.Multiple && KickStarter.settingsManager.SelectInteractionMethod () == AC.SelectInteractions.CyclingCursorAndClickingHotspot)
                {
                    if (KickStarter.settingsManager.autoCycleWhenInteract && _mouseState == MouseState.SingleClick && (selectedItem == null || KickStarter.settingsManager.cycleInventoryCursors))
                    {
                        int originalIndex = KickStarter.playerInteraction.GetInteractionIndex ();
                        KickStarter.playerInteraction.SetNextInteraction ();
                        KickStarter.playerInteraction.SetInteractionIndex (originalIndex);
                    }

                    if (!KickStarter.settingsManager.cycleInventoryCursors && selectedItem != null)
                    {
                        inventoryBox.HandleDefaultClick (_mouseState, _slot, KickStarter.settingsManager.interactionMethod);
                    }
                    else if (_mouseState != MouseState.RightClick)
                    {
                        KickStarter.playerMenus.SetInteractionMenus (false);
                        ClickInvItemToInteract ();
                    }

                    if (KickStarter.settingsManager.autoCycleWhenInteract && _mouseState == MouseState.SingleClick)
                    {
                        KickStarter.playerInteraction.RestoreInventoryInteraction ();
                    }

                }
                else if (KickStarter.settingsManager.interactionMethod != AC_InteractionMethod.ContextSensitive && KickStarter.settingsManager.inventoryInteractions == InventoryInteractions.Single)
                {
                    inventoryBox.HandleDefaultClick (_mouseState, _slot, AC_InteractionMethod.ContextSensitive);
                }
                else
                {
                    inventoryBox.HandleDefaultClick (_mouseState, _slot, KickStarter.settingsManager.interactionMethod);
                }

                _menu.Recalculate ();
            }
            else if (inventoryBox.inventoryBoxType == AC_InventoryBoxType.Container)
            {
                inventoryBox.ClickContainer (_mouseState, _slot, KickStarter.playerInput.activeContainer);
                _menu.Recalculate ();
            }
            else if (inventoryBox.inventoryBoxType == AC_InventoryBoxType.HotspotBased)
            {
                if (KickStarter.settingsManager.interactionMethod == AC_InteractionMethod.ChooseHotspotThenInteraction)
                {
                    if (_menu.GetTargetInvItem () != null)
                    {
                        //Combine (hoverItem, inventoryBox.items [_slot]);
                        Combine (_menu.GetTargetInvItem (), inventoryBox.items [_slot + inventoryBox.GetOffset ()]);
                    }
                    else if (_menu.GetTargetHotspot ())
                    {
                        InvItem _item = inventoryBox.items [_slot + inventoryBox.GetOffset ()];
                        if (_item != null)
                        {
                            //SelectItem (_item, SelectItemMode.Use);
                            _menu.TurnOff (false);
                            KickStarter.playerInteraction.ClickButton (InteractionType.Inventory, -2, _item.id, _menu.GetTargetHotspot ());
                            KickStarter.playerCursor.ResetSelectedCursor ();
                        }
                    }
                    else
                    {
                        ACDebug.LogWarning ("Cannot handle inventory click since there is no active Hotspot.");
                    }
                }
                else
                {
                    ACDebug.LogWarning ("This type of InventoryBox only works with the Choose Hotspot Then Interaction method of interaction.");
                }
            }
        }
开发者ID:WastNotWantNot,项目名称:WasteNotWantNot,代码行数:88,代码来源:RuntimeInventory.cs


注:本文中的AC.TurnOff方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。