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


C# AC.GetTargetHotspot方法代码示例

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


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

示例1: ClickInteractionIcon

 /**
  * <summary>Runs the appropriate interaction after the clicking of a MenuInteraction element.</summary>
  * <param name = "_menu">The Menu that contains the MenuInteraction element</param>
  * <param name = "iconID">The ID number of the "Use" icon, defined in CursorManager, that was clicked on</param>
  */
 public void ClickInteractionIcon(AC.Menu _menu, int iconID)
 {
     if (KickStarter.settingsManager.interactionMethod == AC_InteractionMethod.ContextSensitive)
     {
         Debug.LogWarning ("This element is not compatible with the Context-Sensitive interaction method.");
     }
     else if (KickStarter.settingsManager.interactionMethod == AC_InteractionMethod.ChooseInteractionThenHotspot)
     {
         KickStarter.runtimeInventory.SetNull ();
         KickStarter.playerCursor.SetCursorFromID (iconID);
     }
     else if (KickStarter.settingsManager.interactionMethod == AC_InteractionMethod.ChooseHotspotThenInteraction)
     {
         if (KickStarter.settingsManager.SelectInteractionMethod () != SelectInteractions.ClickingMenu)
         {
             return;
         }
         if (_menu.GetTargetInvItem () != null)
         {
             _menu.ForceOff ();
             KickStarter.runtimeInventory.RunInteraction (iconID, _menu.GetTargetInvItem ());
         }
         else if (_menu.GetTargetHotspot ())
         {
             _menu.ForceOff ();
             ClickButton (InteractionType.Use, iconID, -1, _menu.GetTargetHotspot ());
         }
     }
 }
开发者ID:Davetheallthing,项目名称:Space-Walk,代码行数:34,代码来源:PlayerInteraction.cs

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