Search Unity

Inventory Pro - uGUI - Performance - Mobile support & More

Discussion in 'Assets and Asset Store' started by jorisshh, Mar 8, 2015.

?

What should I build next?

  1. New currency system

    13.2%
  2. Improved serialization / saving for web

    10.8%
  3. Better properties for items (percentages, base values, etc)

    27.0%
  4. Controller support

    15.1%
  5. Unity 5.1 networking (multiplayer)

    37.3%
  6. More modular build to simplify extending

    25.4%
  7. UFPS Multiplayer (Asset integration)

    11.6%
  8. Core GameKit (Asset integration)

    4.2%
  9. Dialogue system (Asset integration)

    21.4%
  10. Wordpress integration (Asset integration)

    4.2%
Multiple votes are allowed.
  1. imgumby

    imgumby

    Joined:
    Nov 26, 2015
    Posts:
    122
    Yeah..that ultimate inventory was a bust from the start.To his credit he at least responded to my queries .I spent hours emailing back and forth with him but never got it to work consistently.waste of money and time..
     
  2. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    148
    Hi
    where is defined the position of the UIs en the canvas?
     
  3. DespairBear

    DespairBear

    Joined:
    Nov 1, 2013
    Posts:
    219
    Hey, considering purchasing this in the next week or so for a multiplayer game. Does this have photon integration?
     
  4. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    877
    Hi there, I have just started using inventory pro and have tried the integration with dialogue system but I am getting this error in the inspector.

    Assets/Devdog/InventoryPro/Scripts/Integration/DialogueSystem/Other/InventoryDialogueSimpleControllerHandler.cs(14,16): error CS0246: The type or namespace name `SimpleController' could not be found. Are you missing `PixelCrushers.DialogueSystem.Demo' or `PixelCrushers.DialogueSystem.Demo.Wrappers' using directive?


    Any ideas what the fix is?
     
  5. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,784
    I don't know if this is the same issue I had, but the demo provided by Devdog didn't work for me either. However, an updated demo scene is included in Pixel Crushers Dialogue System and that one works. You might want to give that a try.
     
    hopeful and AndyNeoman like this.
  6. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    877
    Cheers, I've not tried and demos yet just imported and tried to add integration for dialogue system.
     
  7. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    10,231
    Please use the updated integration package included in the Dialogue System, in Plugins / Pixel Crushers / Dialogue System / Third Party Support.
     
    AndyNeoman and magique like this.
  8. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    877
    Thanks, using the demo pack worked but i'm getting a strange error where the inventory system is trying to add two apples and a pair of gloves that are not in my database. It seems like it is coming from the item inventory utility but im not 100%. Anybody encountered this?
     
  9. rasto61

    rasto61

    Joined:
    Nov 1, 2015
    Posts:
    322
    As far as I remember there is an auto collection populator somewhere that does that (try looking at the collection container where the collection script is)
     
  10. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    4,652
    Free key is gone.
     
    Last edited: Sep 27, 2018
  11. Nadan

    Nadan

    Joined:
    Jan 20, 2013
    Posts:
    341
    Hi,

    I'm starting to use Inventory Pro in my new game, watched tutorial videos and now I need some help.

    So I have the item prefab (made with Inventory Pro) in the game scene. I've also attached gameobject with Player script (with RangeTriggerHandler) and Inventory Player scripts to my player that moves in the game.

    How can I pick up the item prefab in the scene when player goes near it?

    I have followed this Trigger tutorial and it works. The Bank windows opens when player gets near. But when I place item prefab in the scene and set the "Use when player comes in range" nothing happens.

    What I'm trying to do is to player to automatically pick up items it goes near enough.

     
    Last edited: Sep 22, 2018
  12. 7Ye

    7Ye

    Joined:
    Dec 5, 2014
    Posts:
    17
    Hi there. Fantastic Asset.

    I'm having a bit of a problem understanding the Equipment Handler... I have a model with a lot of clothes on it, i extended the script as the documentation says with the ability to Activate/Deactivate a gameobject if the item is equipped or not, but I don't know if the script works, is deprecated, I have to do some scripting objects, where is the info to be put.... Anyone knows? thanks.

    >> https://inventory-pro-docs.readthedocs.io/en/latest/API/EquipmentHandler/
     
  13. 7Ye

    7Ye

    Joined:
    Dec 5, 2014
    Posts:
    17
    I see. After setting correctly the inventory and binding transforms of the player, and some testing with the default handler and the enchanced by the example, the Enabler what does is to activate and deactivate the transform point, instead of instancing the item inside the transform point, which is the default procedure.

    So it's not working out of the box without additional scripting to select specific clothes inside a category. Well. Time to work a little then. That if that I understand the basic functionality of the example extended script.
     
  14. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    331
    using inventory pro with playmaker, there is very very very little information on set up for that. frustrating as hell. I've sent a couple emails to support for inventory pro just asking like a couple basic questions, never heard back. I had the inventory system working pretty much fine, but then with the introduction of playmaker, which im not really needing the playmaker on the inventory pro. I use it for other things. but I cant click on anything. items, windows, close buttons, what ever, nothing. I set up a item with playmaker, to pick this item up. and that seemed to work fine. but I cant get nothing to work, the clean button, close, the take all. its like the mouse just does not want to recognize inventory pro stuff. and it WAS working.
     
  15. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,053
    Have you tried joining the Discord channel? Lots of help to be had there..
     
  16. crypt0

    crypt0

    Joined:
    May 25, 2015
    Posts:
    54
    Hi,
    how can I check, with Weapon is attached and in use to the player, to start the correct animation in the animator? I didn't find information about that. Is there an easy way?

    Thanks
     
  17. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    272
    Hi , i'm lost ... so here's my problem
    links like http://devdog.io/unity-assets/inventory-pro/documentation/2.5p/api/custom-character-controller don't work
    any community plugins/bouns is empty on the site

    now here's what i'm trying to do
    i'm using covershooter plugin to pick up the items inside the inventory pro UI
    and put them into the inventory system of covershooter
    i failed to find the exact functions that is responsible for :
    adding Stats of the player to the covershooter script , so things like speed and STR DEX INT ,, etc will be updated when an item is equiped , and when a gun or axe is equipped , i need the covershooter UI to be updated too so the player can use the gun he just picked up , the inventory pro system is well coded ,but not simple to understand .
    so here's a cry for help , where can i find the items that inventory pro stores them , i need like an items list or something ... so i can pick up each item information and pass them down to the covershooter ...
    and the Stats result after addin all of those items, so i can add them to the covershooter .. Help
    upload_2018-11-18_12-49-35.png
     
  18. natepacyga

    natepacyga

    Joined:
    Apr 7, 2015
    Posts:
    17
    Mark_01 likes this.
  19. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    272
    Hi here's a small hack that will add Drag and drop Visual , by dragging the icon from the slot and put it in the inventory if there's space , or player slots if he can use it .

    just replace ItemCollectionSlotUI with this
    hope it helps
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using UnityEngine.EventSystems;
    4. using UnityEngine.UI;
    5. using System;
    6. using System.Collections.Generic;
    7. using Devdog.General;
    8. using Devdog.General.UI;
    9. using Devdog.InventoryPro.UI;
    10. using UnityEngine.Assertions;
    11.  
    12. namespace Devdog.InventoryPro
    13. {
    14.     [AddComponentMenu(InventoryPro.AddComponentMenuPath + "Collection UI/Slot UI")]
    15.     public partial class ItemCollectionSlotUI : ItemCollectionSlotUIBase, IBeginDragHandler, IEndDragHandler, IDragHandler, IPointerUpHandler, IPointerDownHandler, IPointerEnterHandler, IPointerExitHandler
    16.     {
    17.         #region UI Elements
    18.  
    19.         public Text amountText;
    20.         public Text itemName;
    21.         public Image icon;
    22.  
    23.         public UIShowValue cooldownVisualizer = new UIShowValue();
    24.         public bool disableIconWhenEmpty = false;
    25.  
    26.  
    27.         [NonSerialized]
    28.         private Sprite _startIcon;
    29.  
    30.         public virtual bool isEmpty
    31.         {
    32.             get
    33.             {
    34.                 return item == null;
    35.             }
    36.         }
    37.  
    38.         /// <summary>
    39.         /// Converts the rect transform's rect to screen space (adds the position to it)
    40.         /// </summary>
    41.         public virtual Rect screenSpaceRect
    42.         {
    43.             get
    44.             {
    45.                 var rectTransform = GetComponent<RectTransform>();
    46.                 var pos = rectTransform.position;
    47.  
    48.                 var r = new Rect(rectTransform.rect); // TODO: Doesn't work with camera-space UI
    49.              
    50.                 r.x += pos.x;
    51.                 r.y += pos.y;
    52.  
    53.                 r.width += InventorySettingsManager.instance.settings.onPointerUpInsidePadding.x;
    54.                 r.height += InventorySettingsManager.instance.settings.onPointerUpInsidePadding.y;
    55.  
    56.                 r.x -= (InventorySettingsManager.instance.settings.onPointerUpInsidePadding.x / 2);
    57.                 r.y -= (InventorySettingsManager.instance.settings.onPointerUpInsidePadding.y / 2);
    58.  
    59.                 return r;
    60.             }
    61.         }
    62.  
    63.         public static ItemCollectionSlotUI currentlyHoveringSlot { get; protected set; }
    64.  
    65.         [NonSerialized]
    66.         protected static ItemCollectionSlotUIBase pointerDownOnUIElement;
    67.  
    68.         private bool isPressingButton
    69.         {
    70.             get { return pointerDownOnUIElement != null; }
    71.         }
    72.  
    73.         private bool isLongPress
    74.         {
    75.             get
    76.             {
    77.                 return Mathf.Approximately(lastDownTime, 0f) == false && Time.timeSinceLevelLoad - InventorySettingsManager.instance.settings.mobileLongPressTime > lastDownTime;            
    78.             }
    79.         }
    80.  
    81.         private bool isDoubleTap
    82.         {
    83.             get { return Mathf.Approximately(lastDownTime, 0f) == false && Time.timeSinceLevelLoad < lastDownTime + InventorySettingsManager.instance.settings.mobileDoubleTapTime && Mathf.Approximately(lastDownTime, Time.timeSinceLevelLoad) == false; }
    84.         }
    85.  
    86.  
    87.         /// <summary>
    88.         /// Last time the button was pressed, used to determine long presses.
    89.         /// </summary>
    90.         protected static float lastDownTime { get; set; }
    91.  
    92.         protected bool useCustomUpdate = true;
    93.  
    94.         #endregion
    95.  
    96.         protected virtual void Awake()
    97.         {
    98.             if (icon != null)
    99.             {
    100.                 _startIcon = icon.sprite;
    101.             }
    102.         }
    103.     public    Vector3 Oldpos ;
    104.         protected virtual void OnEnable()
    105.         {
    106.          
    107.             if (useCustomUpdate)
    108.             {
    109.                 StartCustomUpdate();
    110.             }
    111.         }
    112.  
    113.         protected virtual void OnDisable()
    114.         {
    115.             if (useCustomUpdate)
    116.             {
    117.                 StopCustomUpdate();
    118.             }
    119.  
    120.             if (currentlyHoveringSlot == this)
    121.             {
    122.                 currentlyHoveringSlot = null;
    123.             }
    124.  
    125.             if (pointerDownOnUIElement == this)
    126.             {
    127.                 pointerDownOnUIElement = null;
    128.             }
    129.  
    130.             if (InventoryUIDragUtility.isDraggingItem)
    131.             {
    132.                 InventoryUIDragUtility.OnEndDrag(new PointerEventData(EventSystem.current));
    133.             }
    134.         }
    135.  
    136.         protected void StartCustomUpdate()
    137.         {
    138.             InvokeRepeating("CustomUpdate", 0f, 0.05f);
    139.         }
    140.  
    141.         protected void StopCustomUpdate()
    142.         {
    143.             CancelInvoke("CustomUpdate");
    144.         }
    145.  
    146.         protected virtual void CustomUpdate()
    147.         {
    148.             if (gameObject.activeSelf == false)
    149.             {
    150.                 return;
    151.             }
    152.  
    153.             RepaintCooldown();
    154.  
    155.             if (isPressingButton && pointerDownOnUIElement == this && InventoryUIDragUtility.isDraggingItem == false && isLongPress)
    156.             {
    157.                 OnLongTap(new PointerEventData(EventSystem.current), InventoryActionInput.EventType.All); // Long press for mobile
    158.             }
    159.         }
    160.  
    161.  
    162.         #region Button handler UI events
    163.  
    164.         public virtual void OnBeginDrag(PointerEventData eventData)
    165.         {
    166.             InventoryUI = GetComponentInParent <Canvas>().transform;
    167.      
    168.          
    169.             if (itemCollection == null || item == null || itemCollection.canDragInCollection == false)
    170.                 return;
    171.  
    172.             if (item != null && itemCollection.canDragInCollection)
    173.             {
    174.                 Oldpos = icon. transform.position;
    175.          
    176.  
    177.                 InventoryUIDragUtility.OnBeginDrag(this, eventData);
    178.             }
    179.         }
    180.  
    181.         public virtual void OnDrag(PointerEventData eventData)
    182.         {
    183.             if (itemCollection == null || item == null || itemCollection.canDragInCollection == false)
    184.            
    185.  
    186.  
    187.                 return;
    188.  
    189.             var rectTransform = GetComponent<RectTransform>();
    190.             icon.transform.position = eventData.position;
    191.             icon.transform.SetParent (InventoryUI);
    192.             InventoryUIDragUtility.OnDrag(eventData);
    193.  
    194.             //if (eventData.button == PointerEventData.InputButton.Left || (eventData.button == PointerEventData.InputButton.Right && InventorySettingsManager.instance.unstackItemButton == PointerEventData.InputButton.Right))
    195.         }
    196.  
    197.         public virtual void OnEndDrag(PointerEventData eventData)
    198.         {  
    199.                 icon.rectTransform.anchoredPosition = new Vector2 (0, 0);
    200.                 icon.transform.SetParent (this.transform);
    201.                 icon.transform.SetSiblingIndex (0);
    202.                 icon.rectTransform.anchorMin = new Vector2 (0, 0);
    203.                 icon.rectTransform.anchorMax = new Vector2 (1, 1);
    204.                 icon.rectTransform.pivot = new Vector2 (0.5f, 0.5f);
    205.                 icon.rectTransform.offsetMax = new Vector2 (0, 0);
    206.                 icon.rectTransform.offsetMin = new Vector2 (0, 0);
    207.          
    208.             if (itemCollection == null || item == null || itemCollection.canDragInCollection == false)
    209.      
    210.              
    211.          
    212.                 return;
    213.  
    214.             var lookup = InventoryUIDragUtility.OnEndDrag(eventData);
    215.             if (lookup == null)
    216.                 return; // No drag handler.
    217.  
    218.  
    219.  
    220.             // for mobile...
    221.             var endOnData = UIUtility.PointerOverUIObject(InventoryManager.instance.uiRoot, InventoryUIUtility.mouseOrTouchPosition);
    222.             foreach (var d in endOnData)
    223.             {
    224.                 var slot = d.gameObject.GetComponent<ItemCollectionSlotUIBase>();
    225.                 if (slot != null) {
    226.                     lookup.endItemCollection = slot.itemCollection;
    227.                     lookup.endIndex = (int)slot.index;
    228.  
    229.                     break;
    230.                 } else {
    231.  
    232.  
    233.                 }
    234.             }
    235.  
    236.             if (lookup.endOnSlot)
    237.             {
    238.                 #region Slot movement
    239.  
    240.                 // When is large and dragged the end drag event can happen on the slots that's being dragged.
    241.                 // from     x       x
    242.                 // x        to      x
    243.                 // x        x       x
    244.                 // From -> To -> 1 down -> 1 to the right
    245.  
    246.                 // Offset things for the layout
    247.                 var i = lookup.endItemCollection[lookup.endIndex].item;
    248.                 if (i != null)
    249.                 {
    250.                     if (i == item && item.layoutSize > 1)
    251.                      
    252.                     {
    253.                      
    254.                      
    255.                         // Ended on self, and we're larger than 1x1 -- Try to move item to the side
    256.                         var rect = transform.GetComponent<RectTransform>();
    257.                         var tempItem = lookup.endItemCollection[lookup.endIndex].item;
    258.  
    259.                         var singleSize = rect.sizeDelta;
    260.                         singleSize.x /= tempItem.layoutSizeCols;
    261.                         singleSize.y /= tempItem.layoutSizeRows;
    262.  
    263.                         var dif = eventData.pressPosition - eventData.position;
    264.                         var stepsCols = Mathf.RoundToInt(-dif.x / singleSize.x);
    265.                         var stepsRows = Mathf.RoundToInt(dif.y / singleSize.y);
    266.  
    267.                         lookup.endIndex += (int)(stepsCols + (stepsRows*lookup.endItemCollection.colsCount));
    268.                         lookup.endIndex = Mathf.Clamp(lookup.endIndex, 0, lookup.endItemCollection.items.Length - 1);
    269.                     }
    270.                 }else {
    271.                  
    272.              
    273.  
    274.                 }
    275.  
    276.                 #endregion
    277.  
    278.                 // Place on a slot
    279.                 if (InventorySettingsManager.instance.settings.useUnstackDrag && lookup.endItemCollection.useReferences == false && lookup.endItemCollection.canUnstackItemsInCollection)
    280.                 {
    281.                     if (InventorySettingsManager.instance.settings.unstackKeys.AllPressed(eventData, InventoryActionInput.EventType.All))
    282.                     {
    283.                         TriggerUnstack(lookup.endItemCollection, lookup.endIndex);
    284.                         return; // Stop the rest otherwise we'll do 2 actions at once.                    
    285.                     }
    286.                 }
    287.  
    288.                 lookup.startItemCollection.SwapOrMerge((uint)lookup.startIndex, lookup.endItemCollection, (uint)lookup.endIndex);
    289.             }
    290.             else if (lookup.startItemCollection.useReferences)
    291.             {
    292.                 lookup.startItemCollection.SetItem((uint)lookup.startIndex, null);
    293.                 lookup.startItemCollection[lookup.startIndex].Repaint();
    294.             }
    295.             else if (UIUtility.isHoveringUIElement == false)
    296.             {
    297.                 TriggerDrop();
    298.             }
    299.  
    300.             if (this.GetComponent < EquippableSlot>() == null) {
    301.  
    302.          
    303.             } else    if (item !=null){
    304.  
    305.  
    306.              
    307.                 TriggerUse();
    308.                     return;
    309.              
    310.  
    311.             }
    312.  
    313.         }
    314.         int UIIndex ;
    315.         public virtual void OnPointerDown(PointerEventData eventData)
    316.         {
    317.             if (itemCollection == null)
    318.                 return;
    319.  
    320.             pointerDownOnUIElement = currentlyHoveringSlot;
    321.             if (pointerDownOnUIElement == null)
    322.                 return;
    323.  
    324.  
    325.             //////////// Ugly hack, because input modules will take over soon.
    326.             bool tapped = OnTap(eventData, InventoryActionInput.EventType.OnPointerDown); // Mobile version of OnPointerUp
    327.             if (tapped)
    328.             {
    329.                 return;
    330.             }
    331.  
    332.             if (isDoubleTap)
    333.             {
    334.                 OnDoubleTap(eventData, InventoryActionInput.EventType.OnPointerDown);
    335.                 return;
    336.             }
    337.      
    338.             var s = InventorySettingsManager.instance.settings;
    339.             if (s.useContextMenu && s.triggerContextMenuKeys.AllPressed(eventData, InventoryActionInput.EventType.OnPointerDown))
    340.             {
    341.                 if (item != null)
    342.                 {
    343.                     TriggerContextMenu();
    344.                     return;
    345.                 }
    346.             }
    347.  
    348.             lastDownTime = Time.timeSinceLevelLoad;
    349.         }
    350.  
    351.         public virtual void OnPointerUp(PointerEventData eventData)
    352.         {
    353.             // Started on a UI element?
    354.             if (pointerDownOnUIElement == null)
    355.                 return;
    356.  
    357.             pointerDownOnUIElement = null;
    358. //            lastDownTime = 0f;
    359.  
    360.             // Cursor still inside the button on Pointer up?
    361.             var canvas = gameObject.GetComponentInParent<Canvas>();
    362.             if(canvas.renderMode == RenderMode.ScreenSpaceOverlay)
    363.             {
    364.                 if (screenSpaceRect.Contains(eventData.position) == false)
    365.                     return;
    366.             }
    367.  
    368.             if (isDoubleTap)
    369.             {
    370.                 OnDoubleTap(eventData, InventoryActionInput.EventType.OnPointerUp);
    371.                 return;
    372.             }
    373.  
    374.             bool tapped = OnTap(eventData, InventoryActionInput.EventType.OnPointerUp); // Mobile version of OnPointerUp
    375.             if (tapped)
    376.             {
    377.                 return;
    378.             }
    379.  
    380.             var s = InventorySettingsManager.instance.settings;
    381.             if (s.useContextMenu && s.triggerContextMenuKeys.AllPressed(eventData, InventoryActionInput.EventType.OnPointerUp))
    382.             {
    383.                 if (item != null)
    384.                 {
    385.                     TriggerContextMenu();
    386.                     return;
    387.                 }
    388.             }
    389.  
    390.             if (item != null && InventoryUIDragUtility.isDraggingItem == false)
    391.             {
    392.                 // Check if we're trying to unstack
    393.                 if (itemCollection.useReferences == false && InventorySettingsManager.instance.settings.useUnstackClick && itemCollection.canUnstackItemsInCollection)
    394.                 {
    395.                     if (InventorySettingsManager.instance.settings.unstackKeys.AllPressed(eventData, InventoryActionInput.EventType.OnPointerUp))
    396.                     {
    397.                         TriggerUnstack(itemCollection);
    398.                         return; // Stop the rest otherwise we'll do 2 actions at once.
    399.                     }
    400.                 }
    401.  
    402.                 // Use the item
    403.                 if (InventorySettingsManager.instance.settings.useItemKeys.AllPressed(eventData, InventoryActionInput.EventType.OnPointerUp))
    404.                     TriggerUse();
    405.  
    406.             }
    407.         }
    408.  
    409.         /// <summary>
    410.         /// Check if mobile input is valid.
    411.         /// </summary>
    412.         /// <param name="tap"></param>
    413.         /// <param name="eventData"></param>
    414.         /// <returns>True if an action was taken, false if no action was taken.</returns>
    415.         protected virtual bool CheckMobileInput(InventoryActionInput.MobileUIActions tap, InventoryActionInput.EventType eventUsed, PointerEventData eventData)
    416.         {
    417.             var s = InventorySettingsManager.instance.settings;
    418.             if (s.unstackKeys.AllPressed(tap, eventUsed, eventData))
    419.             {
    420.                 TriggerUnstack(itemCollection);
    421.                 return true;
    422.             }
    423.  
    424.             if (s.useItemKeys.AllPressed(tap, eventUsed, eventData))
    425.             {
    426.                 TriggerUse();
    427.                 return true;
    428.             }
    429.  
    430.             if (s.triggerContextMenuKeys.AllPressed(tap, eventUsed, eventData))
    431.             {
    432.                 if (s.useContextMenu)
    433.                 {
    434.                     TriggerContextMenu();
    435.                     return true;
    436.                 }
    437.             }
    438.  
    439.             return false; // No action taken
    440.         }
    441.  
    442.         public virtual bool OnTap(PointerEventData eventData, InventoryActionInput.EventType eventUsed)
    443.         {
    444.             return CheckMobileInput(InventoryActionInput.MobileUIActions.SingleTap, eventUsed, eventData);
    445.         }
    446.  
    447.         public virtual bool OnDoubleTap(PointerEventData eventData, InventoryActionInput.EventType eventUsed)
    448.         {
    449.             return CheckMobileInput(InventoryActionInput.MobileUIActions.DoubleTap, eventUsed, eventData);
    450.         }
    451.  
    452.         public virtual bool OnLongTap(PointerEventData eventData, InventoryActionInput.EventType eventUsed)
    453.         {
    454.             return CheckMobileInput(InventoryActionInput.MobileUIActions.LongTap, eventUsed, eventData);
    455.         }
    456.  
    457.         #endregion
    458.  
    459.         #region Triggers
    460.  
    461.         public override void TriggerContextMenu()
    462.         {
    463.             if (item == null)
    464.                 return;
    465.  
    466.             var contextMenu = InventoryManager.instance.contextMenu;
    467.  
    468.             // Show context menu
    469.             contextMenu.ClearMenuOptions();
    470.  
    471.             var itemList = item.GetUsabilities();
    472.             itemList = itemCollection.GetExtraItemUsabilities(itemList);
    473.             foreach (var i in itemList)
    474.             {
    475.                 contextMenu.AddMenuOption(i.actionName, item, i.useItemCallback);
    476.             }
    477.  
    478.             contextMenu.window.Show();
    479.         }
    480.  
    481.         // <inheritdoc />
    482.         public override void TriggerUnstack(ItemCollectionBase toCollection, int toIndex = -1)
    483.         {
    484.             if (item == null || itemCollection.useReferences || itemCollection.canUnstackItemsInCollection == false)
    485.                 return;
    486.  
    487.             if (item.currentStackSize > 1)
    488.             {
    489.                 var m = InventorySettingsManager.instance;
    490.                 if(m.settings.useUnstackDialog)
    491.                 {
    492.                     var d = InventoryManager.langDatabase.unstackDialog;
    493.                     InventoryManager.instance.unstackDialog.ShowDialog(itemCollection.transform, d.title, d.message, 1, (int)item.currentStackSize - 1, item,
    494.                         (int val) =>
    495.                         {
    496.                             if (toIndex != -1)
    497.                                 itemCollection.UnstackSlot(index, toCollection, (uint) toIndex, (uint)val, true);
    498.                             else
    499.                                 itemCollection.UnstackSlot(index, (uint)val, true);
    500.                         },
    501.                         (int val) =>
    502.                         {
    503.                             // Canceled
    504.  
    505.  
    506.                         });
    507.                 }
    508.                 else
    509.                 {
    510.                     if(toIndex != -1)
    511.                         itemCollection.UnstackSlot(index, toCollection, (uint)toIndex, (uint)Mathf.Floor(item.currentStackSize / 2), true);                
    512.                     else
    513.                         itemCollection.UnstackSlot(index, (uint)Mathf.Floor(item.currentStackSize / 2), true);
    514.                 }
    515.             }
    516.         }
    517.  
    518.         public override void TriggerDrop(bool useRaycast = true)
    519.         {
    520.             if (item == null || itemCollection.canDropFromCollection == false)
    521.                 return;
    522.          
    523.             Assert.IsNotNull(PlayerManager.instance.currentPlayer, "Current player is not set, can't drop item.");
    524.  
    525.             if(item.isDroppable == false)
    526.             {
    527.                 InventoryManager.langDatabase.itemCannotBeDropped.Show(item.name, item.description);
    528.                 return;
    529.             }
    530.  
    531.             var s = InventorySettingsManager.instance;
    532.             if (s.settings.showConfirmationDialogWhenDroppingItem && InventoryManager.instance.confirmationDialog == null)
    533.             {
    534.                 Debug.LogError("Trying to drop item with confimration dialog, but dialog is not assigned, please check your settings.");
    535.                 return;
    536.             }
    537.  
    538.             if (s.settings.showConfirmationDialogWhenDroppingItem)
    539.             {
    540.                 // Not on a button, drop it
    541.                 var tempItem = item; // Capture list stuff
    542.                 var msg = InventoryManager.langDatabase.confirmationDialogDrop;
    543.                 InventoryManager.instance.confirmationDialog.ShowDialog(itemCollection.transform, msg.title, msg.message, item,
    544.                     (dialog) =>
    545.                     {
    546.                         tempItem.Drop();
    547.                     },
    548.                     (dialog) =>
    549.                     {
    550.                         //Debug.Log("No clicked");
    551.                     });
    552.             }
    553.             else
    554.             {
    555.                 item.Drop();
    556.             }
    557.         }
    558.  
    559.         public override void TriggerUse()
    560.         {
    561.             if (item == null)
    562.                 return;
    563.  
    564.             // Avoid reference using something from other collection that doesn't allow it.
    565.             if (itemCollection.useReferences && item.itemCollection.canUseItemsFromReference == false)
    566.                 return;
    567.  
    568.             item.Use();
    569.  
    570.             if (itemCollection.useReferences)
    571.                 itemCollection.NotifyReferenceUsed(item, item.ID, index, 1);
    572.  
    573.             Repaint();
    574.         }
    575.  
    576.         #endregion
    577.  
    578.  
    579.         /// <summary>
    580.         /// Repaints the item icon and amount.
    581.         /// </summary>
    582.         public override void Repaint()
    583.         {
    584.             if (item != null)
    585.             {
    586.                 if (amountText != null)
    587.                 {
    588.                     // Only show when we have more then 1 item.
    589.                     if (item.currentStackSize > 1)
    590.                     {
    591.                         amountText.text = item.currentStackSize.ToString();
    592.                         SetActive(amountText, true);
    593.                     }
    594.                     else
    595.                     {
    596.                         amountText.text = string.Empty;
    597.                         SetActive(amountText, false);
    598.                     }
    599.                 }
    600.  
    601.                 if (itemName != null)
    602.                 {
    603.                     itemName.text = item.name;
    604.                     SetActive(itemName, true);
    605.                 }
    606.  
    607.                 if (icon != null)
    608.                 {
    609.                     icon.sprite = item.icon;
    610.                     SetActive(icon, true);
    611.                 }
    612.             }
    613.             else
    614.             {
    615.                 if (amountText != null)
    616.                 {
    617.                     SetActive(amountText, false);
    618.                 }
    619.  
    620.                 if (itemName != null)
    621.                 {
    622.                     SetActive(itemName, false);
    623.                 }
    624.  
    625.                 if (icon != null)
    626.                 {
    627.                     icon.gameObject.SetActive(!disableIconWhenEmpty);
    628.                     icon.sprite = _startIcon;
    629.                 }
    630.             }
    631.         }
    632.  
    633.         protected void SetActive(MonoBehaviour b, bool set)
    634.         {
    635.             // Check to avoid GC
    636.             if (b.gameObject.activeSelf != set)
    637.             {
    638.                 b.gameObject.SetActive(set);
    639.             }
    640.         }
    641.  
    642.         public virtual void RepaintCooldown()
    643.         {
    644.             if (item != null)
    645.             {
    646.                 if(item.isInCooldown)
    647.                 {
    648.                     cooldownVisualizer.Repaint((1.0f - item.cooldownFactor) * item.cooldownTime, item.cooldownTime);
    649.                     return;
    650.                 }
    651.             }
    652.  
    653.             cooldownVisualizer.HideAll();
    654. //            cooldownVisualizer.Repaint(0.0f, 1.0f);
    655.         }
    656.  
    657.  
    658.         public void OnPointerEnter(PointerEventData eventData)
    659.         {
    660.             currentlyHoveringSlot = this;
    661.         }
    662.  
    663.         public void OnPointerExit(PointerEventData eventData)
    664.         {
    665.             pointerDownOnUIElement = null;
    666.             if (currentlyHoveringSlot == this)
    667.             {
    668.                 currentlyHoveringSlot = null;
    669.             }
    670.         }
    671.     }
    672. }
     
    hopeful likes this.
  20. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    272
    one small issue you have to set the Icon in the UI_Item_PFB prefab to no raycast target or it wont work upload_2018-12-3_2-17-17.png
     
  21. Rahd

    Rahd

    Joined:
    May 30, 2014
    Posts:
    272
    Not sure if this was fixed or not but this is an exploit players can use .
    so take this example
    - the player will have a full inventory except 6 slots
    -the axe in his hand is 6 slots
    - he has boots that can be equipped only when requirements are met
    -the axe provides those requirements that's why the boots are equipped
    Problem :
    when you unequip the axe the boots stay on because the bag is full
    so my fix was to drop the items that he can't equip.

    the script will be messaged to the Dev , because i can't post the full code
     
    hopeful likes this.
  22. port1234

    port1234

    Joined:
    Jun 15, 2017
    Posts:
    2
    Hi. How to check the availability of an item in my inventory, for example, if (itemname == 10)
     
  23. Mark_01

    Mark_01

    Joined:
    Mar 31, 2016
    Posts:
    451
    I am bumping / asking the same question, Ultimate Character Controller
    has been out for a while now... will there be integration ?
    Thanks.
     
  24. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    525
    Hi there…

    I'm trying to set up the system following the tutorials and i'm stucked in the creation of an ítem. The problem is that each time i create a new item, be a cube or a model for a consumable iítem, it creates a prefab of a model without all the components needed, just mesh filter and mesh renderer. If i try a second time, then will be created a new prefab with another name with all the needed scripts, but as soon as i try to enter the name of the ítem in the main editor window, it simply dissapear from the editor and from the ítem database. The prefab is still there, but i need to add it to the list manually to be able to see it in the ítem editor window. The wizard says everything is all right.
    I've reinstalled the asset several times and started over and over again, but it is always the same. I'm using Unity 2018.3.0f2.

    Any idea of what i'm doing wrong?
    Thanks a lot!
     
  25. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    525
    Then, after clicing to change the name of the ítem in the main editor, i get the following errors;

    MissingReferenceException: The object of type 'ConsumableInventoryItem' has been destroyed but you are still trying to access it.

    and

    GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced.

    …. Thanks!
     
  26. unclefour123

    unclefour123

    Joined:
    Jan 27, 2019
    Posts:
    2
    Hi I am very happy to use inven pro to build my game, however it is not very friendly to mobile device. So I need to modify many things. Anyway I like the context menu, it is much easier than input long tap or double tap to do the actions in mobile device. But when I set position at mouse, it doesnt work in mobile (but work if not set) maybe it only reconise the mouse position. So I add get touch position in the code, but it is still not working. Is that anyway to make it work in mobile or position the window just next to the slot? Thank you
     
  27. unclefour123

    unclefour123

    Joined:
    Jan 27, 2019
    Posts:
    2
    Hi,is there any possible way to change the language of the context menu option? I can't find the code I should do the change.
     
  28. Mark_01

    Mark_01

    Joined:
    Mar 31, 2016
    Posts:
    451
    SOooo do the dev's even look or care ??? this is a forum as well... I posted a question
    DEC 31 and still no answer ??? One would think they would be jumping to do interrogation with
    Opsive UCC
     
  29. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,070
    Further up somewhere in the thread should be a note that questions are being answered on their Discord channel.
     
  30. Cereal_Killa

    Cereal_Killa

    Joined:
    Oct 20, 2013
    Posts:
    205
    Is it possible to enchant, gem and modify items? It would essentially be the same as a coin pouch item that already exists (an item with its own inventory), except that items within the item would add stats to the parent item. So the gem/enchant /armor patch would be saved as the contents or child of the main armor piece and could be overwritten by dragging another gem etc to the same slot.
     
    andreiagmu likes this.
  31. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,784
    I'm getting IP up and running with my current game and I see an issue I've seen in the past, but never had an answer for. When I press my menu button and get the series of icons for Settings, Inventory, Map, and Quest, the Selector dotted square doesn't show up at all. And pressing the Horizontal axis input to move between them doesn't do anything. So, I can never select anything. However, if I move my mouse left and right then the dashed box appears and selects each item. But with the Joystick on my console system, pressing the Horizontal axis input doesn't seem to work at all. I'm trying to find the code that controls this, but haven't found it so I am unable to debug it.

    This is in the Controller demo scene.

    [EDIT]
    I re-imported the scene and started over from scratch and now it is working for me. I will proceed as I did last time by changing the icon images and then adding text beneath them. Maybe one of those things is causing it to get messed up. If so, I'll let you know and maybe we can figure out why.
     
    Last edited: Jun 8, 2019
  32. drcfrx

    drcfrx

    Joined:
    Jan 26, 2013
    Posts:
    40
    Devdog released their old tools like Inventory Pro as Open Source under MIT License, see this blog post.
    They say that people who bought Inventory Pro under 30 days can ask a refund (see same post).

    So from now on, the asset is Deprecated, and all support is abandonned. However they still keep their IP discord channel open (for now...) so that Users can help each other (but they probably won't give support at all any longer).

    So now is the time for their 100k users/buyers (!) to gather their strength in common and make out of IPro the best free community Inventory system in the world. Github Link
     
    Alverik likes this.
  33. Khermit

    Khermit

    Joined:
    Jul 29, 2017
    Posts:
    6
    I'm using Easy Save 2, and I would like to save when an item is picked up.
    When I pickup an item, the item is destroyed. Where is the script which allowed this behavior ? I want to save the destroyed item, as destroyed item, allowing me to detroy it when I'm loading.
    Moodkie gave the script to save a destroyed object here : https://moodkie.com/forum/viewtopic...KwNYrr260r5iFAX3i5EL8BRXtTMetAPVaw4mowqTOosBM
    So I want to replace the script used by Inventory Pro with Moodkie's one.
     
    John-G likes this.
  34. treshold

    treshold

    Joined:
    Nov 9, 2013
    Posts:
    220
    Looks like ItemTrigger.cs holds the logic to destroy prefab when it is added to inventory.
     
    Khermit likes this.
  35. Khermit

    Khermit

    Joined:
    Jul 29, 2017
    Posts:
    6
    It's working, thank you !
     
    treshold likes this.
  36. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    665
    I'm surprised this was deprecated.
     
  37. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    331
    ? You shouldnt be...
     
  38. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    665
    Why not?
     
  39. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    331
    It went open source and is free now.
     
    StevenPicard likes this.
  40. StevenPicard

    StevenPicard

    Joined:
    Mar 7, 2016
    Posts:
    665
    That's great. It would be nice if more asset developers did that when they deprecated their assets.

    Thanks for letting me know.
     
    JBR-games likes this.
  41. Lucas_Lundmark

    Lucas_Lundmark

    Joined:
    May 18, 2017
    Posts:
    1
    Hi! i was just checking, did you ever figure out how to have several crafting windows?
     
unityunity