Category Attribute View Set values Disappearing

Hey there,

So when making the Category Attribute View Set and assigning prefabs to the various slots everything works fine provided the Categories Attribute Boxes array remains at 1. As soon as you add a new category, the values seem to disappear for me and don't stick.

Here's a video of the issue in action:
https://streamable.com/dx1mmf

I'm currently on Unity 2021.2.7f1 and UIS 1.2.5 on Windows 10 if that helps.

Thanks!
 
Well that's a weird bug...
I made a change which seems to fix it... but it still seems odd that an object on an other index whould get affected by the change on the first.

The change I made required changes in a few editor scripts. Essentially the field was of type Object when it should be of type GameObject. But I use the same view somewhere else where is does require type Object. So I changed the constructor to take in a Type parameter.

So replace the files attached.

And then in ItemBindingInspector change line 59:
Code:
m_ItemCategoryAttributeBindingView = new ItemCategoryAttributeBindingView(m_DatabaseField.value as InventorySystemDatabase, typeof(Object));

And in the CategoryAttributeViewSetInspector change line 120
Code:
m_DatabaseField.value as InventorySystemDatabase, typeof(GameObject), true);

Hopefully that fixes the issue. Do let me know if it still causes issues.
 

Attachments

  • AttributeBindingView.cs
    6.9 KB · Views: 3
  • AttributeNameBindingInspector.cs
    3.4 KB · Views: 3
  • ItemCategoryAttributeBindingView.cs
    13.8 KB · Views: 3
Hey again! So I updated to a clean import of UIS 1.2.6 in my current project. The clean install didn't fix the issue, so I continued with the changes you made and that didn't work either.

I then decided to take a step back from my project and do everything in a clean Unity project. I was able to replicate my issue with both a clean project of UIS 1.2.6 and the modifications you provided above. I did find something that reproduces the error for me:

1. Open up Assets/Opsive/UltimateInventorySystem/Demo/Demo.unity
2. Select Scriptable Object Assets/Opsive/UltimateInventorySystem/Demo/UI/Demo Category Attribute View Set.asset
3. Select Weapons and note that there are filled in values. Now select Armor. Go back to Weapons and see that values are reset.

Video of clean install of UIS 1.2.6 reproducing the error: https://streamable.com/bwzssz (skip ahead to about 45 seconds in to see the problem)
Video of modified install of UIS 1.2.6 reproducing the error: https://streamable.com/esd859

And yea just incase it is of importance I am using Unity 2021.2.7f1 and Win 10.
 
I think this problem is related to the Unity version. I tried 2019.4 and 2021.1 and both work fine.

Then I tried in 2021.2.9f1 and I had the same issue you have.
So I belive I found the correct fix this time.
Please replace the script attached
 

Attachments

  • AttributeBindingView.cs
    7 KB · Views: 2
Thanks so much for this fix! I combined this script with the previous scripts you provided for allowing a gameobject as the type. It looks like the values are sticking for me now!

If at all possible in future releases, could you make the following 2 changes to the source scripts as well? I need to override a couple of functions for split screen purposes:

In DisplayManagerHandler.cs at line 100:
protected virtual void HandleGameplayPanelSelected

In ItemVisualizerBase.cs at line 96:
protected virtual void UpdateItemView(ItemInfo itemInfo)
 
Top