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


C# Menu.ForceOff方法代码示例

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


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

示例1: UpdateMenu

		private void UpdateMenu (Menu menu)
		{
			Vector2 invertedMouse = playerInput.GetInvertedMouse ();
			UpdateMenuPosition (menu, invertedMouse);
			
			menu.HandleTransition ();
			
			if (settingsManager)
			{
				if (settingsManager.inputMethod == InputMethod.KeyboardOrController && menu.IsEnabled () &&
				    ((stateHandler.gameState == GameState.Paused && menu.pauseWhenEnabled) || (stateHandler.gameState == GameState.DialogOptions && menu.appearType == AppearType.DuringConversation)))
				{
					playerInput.selected_option = menu.ControlSelected (playerInput.selected_option);
				}
			}
			else
			{
				Debug.LogWarning ("A settings manager is not present.");
			}
			
			if (menu.appearType == AppearType.Manual)
			{
				if (menu.IsVisible () && !menu.isLocked && menu.GetRect ().Contains (invertedMouse) && !menu.ignoreMouseClicks)
				{
					playerInput.mouseOverMenu = true;
				}
			}
			
			else if (menu.appearType == AppearType.DuringGameplay)
			{
				if (stateHandler.gameState == GameState.Normal && !menu.isLocked && menu.IsOff ())
				{
					menu.TurnOn (true);
					
					if (menu.GetRect ().Contains (invertedMouse) && !menu.ignoreMouseClicks)
					{
						playerInput.mouseOverMenu = true;
					}
				}
				else if (stateHandler.gameState == GameState.Paused)
				{
					menu.TurnOff (true);
				}
				else if (stateHandler.gameState != GameState.Normal && menu.IsOn () && actionListManager.AreActionListsRunning ())
				{
					menu.TurnOff (true);
				}
			}
			
			else if (menu.appearType == AppearType.MouseOver)
			{
				if (stateHandler.gameState == GameState.Normal && !menu.isLocked && menu.GetRect ().Contains (invertedMouse))
				{
					if (menu.IsOff ())
					{
						menu.TurnOn (true);
					}
					
					if (!menu.ignoreMouseClicks)
					{
						playerInput.mouseOverMenu = true;
					}
				}
				else if (stateHandler.gameState == GameState.Paused)
				{
					menu.ForceOff ();
				}
				else
				{
					menu.TurnOff (true);
				}
			}
			
			else if (menu.appearType == AppearType.OnContainer)
			{
				if (playerInput.activeContainer != null && !menu.isLocked && (stateHandler.gameState == GameState.Normal || (stateHandler.gameState == AC.GameState.Paused && menu.pauseWhenEnabled)))
				{
					if (menu.IsVisible () && menu.GetRect ().Contains (invertedMouse) && !menu.ignoreMouseClicks)
					{
						playerInput.mouseOverMenu = true;
					}
					menu.TurnOn (true);
				}
				else
				{
					menu.TurnOff (true);
				}
			}
			
			else if (menu.appearType == AppearType.DuringConversation)
			{
				if (playerInput.activeConversation != null && stateHandler.gameState == GameState.DialogOptions)
				{
					menu.TurnOn (true);
				}
				else if (stateHandler.gameState == GameState.Paused)
				{
					menu.ForceOff ();
				}
				else
//.........这里部分代码省略.........
开发者ID:amutnick,项目名称:CrackTheCode_Repo,代码行数:101,代码来源:PlayerMenus.cs

示例2: CheckClick


//.........这里部分代码省略.........
						}
						_menu.Recalculate ();
					}
					else if (inventoryBox.inventoryBoxType == AC_InventoryBoxType.Container)
					{
						inventoryBox.ClickContainer (_mouseState, _slot, playerInput.activeContainer);
						_menu.Recalculate ();
					}
					else if (inventoryBox.inventoryBoxType == AC_InventoryBoxType.HostpotBased)
					{
						if (settingsManager.interactionMethod == AC_InteractionMethod.ChooseHotspotThenInteraction)
						{
							if (runtimeInventory.selectedItem != null)
							{
								runtimeInventory.Combine (inventoryBox.items [_slot]);
							}
							else if (playerInteraction.GetActiveHotspot ())
							{
								InvItem _item = inventoryBox.items [_slot];
								if (_item != null)
								{
									runtimeInventory.SelectItem (_item);
									_menu.TurnOff (false);
									playerInteraction.ClickButton (InteractionType.Inventory, -2, _item.id);
									playerCursor.ResetSelectedCursor ();
								}
							}
							else
							{
								Debug.LogWarning ("Cannot handle inventory click since there is no active Hotspot.");
							}
						}
						else
						{
							Debug.LogWarning ("This type of InventoryBox only works with the Choose Hotspot Then Interaction method of interaction.");
						}
					}
				}
				
				else if (_element is MenuCrafting)
				{
					MenuCrafting recipe = (MenuCrafting) _element;
					
					if (recipe.craftingType == CraftingElementType.Ingredients)
					{
						recipe.HandleDefaultClick (_mouseState, _slot);
					}
					else if (recipe.craftingType == CraftingElementType.Output)
					{
						recipe.ClickOutput (_menu, _mouseState);
					}
					
					_menu.Recalculate ();
				}
				
				else if (_element is MenuInteraction)
				{
					MenuInteraction interaction = (MenuInteraction) _element;
					
					if (settingsManager.interactionMethod == AC_InteractionMethod.ContextSensitive)
					{
						Debug.LogWarning ("This element is not compatible with the Context-Sensitive interaction method.");
					}
					else if (settingsManager.interactionMethod == AC_InteractionMethod.ChooseInteractionThenHotspot)
					{
						playerCursor.SetCursorFromID (interaction.iconID);
					}
					else if (settingsManager.interactionMethod == AC_InteractionMethod.ChooseHotspotThenInteraction)
					{
						if (runtimeInventory.selectedItem != null)
						{
							_menu.ForceOff ();
							runtimeInventory.RunInteraction (false, interaction.iconID);
						}
						else if (playerInteraction.GetActiveHotspot ())
						{
							_menu.ForceOff ();
							playerInteraction.ClickButton (InteractionType.Use, interaction.iconID, -1);
						}
					}
				}
				
				else if (_element is MenuInput)
				{
					SelectInputBox ((MenuInput) _element);
				}
				
				else if (_element is MenuDrag)
				{
					if (_mouseState == MouseState.SingleClick)
					{
						MenuDrag drag = (MenuDrag) _element;
						drag.StartDrag (_menu);
						playerInput.activeDragElement = drag;
					}
				}
				
				PlayerMenus.ResetInventoryBoxes ();
			}
		}
开发者ID:amutnick,项目名称:CrackTheCode_Repo,代码行数:101,代码来源:PlayerMenus.cs


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