New Currency Setup from fresh scene

Ando5000

Member
As the title suggests this was in a fresh scene , i tested to make sure buying and selling worked from the shop before changing this.

In setup window I deleted the three currency that are available and made my own. Copper, Silver, Gold, & Platinum. Removing Bronze and renaming it to copper basically, while adding Platinum.

Errors were thrown right away and I was not able to setup exchange rates properly.



MissingReferenceException: The object of type 'Currency' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Object.get_name () (at <2e6610ed29844f85a37924f81509fe5d>:0)
Opsive.UltimateInventorySystem.Exchange.Currency.ToString () (at Assets/Opsive/UltimateInventorySystem/Scripts/Exchange/Currency.cs:565)
Opsive.UltimateInventorySystem.Editor.VisualElements.ViewNames.ViewName`1[T].Refresh () (at Assets/Opsive/UltimateInventorySystem/Editor/VisualElements/ViewNames/ViewName.cs:61)
Opsive.UltimateInventorySystem.Editor.VisualElements.ViewNames.CurrencyViewName.Refresh () (at Assets/Opsive/UltimateInventorySystem/Editor/VisualElements/ViewNames/CurrencyViewName.cs:32)
Opsive.UltimateInventorySystem.Editor.VisualElements.ViewNames.ViewName`1[T].Refresh (T obj) (at Assets/Opsive/UltimateInventorySystem/Editor/VisualElements/ViewNames/ViewName.cs:53)
Opsive.UltimateInventorySystem.Editor.VisualElements.InventoryObjectField`1[T].Refresh (T obj) (at Assets/Opsive/UltimateInventorySystem/Editor/VisualElements/InventoryObjectField.cs:257)
Opsive.UltimateInventorySystem.Editor.Managers.CurrencyManager.UpdateElements (Opsive.UltimateInventorySystem.Exchange.Currency currency) (at Assets/Opsive/UltimateInventorySystem/Editor/Managers/CurrencyManager.cs:217)
Opsive.UltimateInventorySystem.Editor.Managers.InventorySystemObjectBaseManager`1[T].OnSelected (System.Int32 index) (at Assets/Opsive/UltimateInventorySystem/Editor/Managers/InventorySystemObjectBaseManager.cs:102)
Opsive.UltimateInventorySystem.Editor.Managers.ListPanel`1[T].<.ctor>b__7_4 (System.Int32 index) (at Assets/Opsive/UltimateInventorySystem/Editor/Managers/ListPanel.cs:73)
Opsive.UltimateInventorySystem.Editor.VisualElements.SearchableList`1[T].<.ctor>b__19_2 (System.Int32 index) (at Assets/Opsive/UltimateInventorySystem/Editor/VisualElements/SearchableList.cs:101)
Opsive.Shared.Editor.UIElements.ReorderableList.SelectItem (System.Int32 index) (at <d0cea14bd50a4c1eb6ce133a0ead3fa0>:0)
Opsive.Shared.Editor.UIElements.ReorderableList.set_SelectedIndex (System.Int32 value) (at <d0cea14bd50a4c1eb6ce133a0ead3fa0>:0)
Opsive.UltimateInventorySystem.Editor.VisualElements.SearchableList`1[T].SearchSortRefresh (System.String searchString) (at Assets/Opsive/UltimateInventorySystem/Editor/VisualElements/SearchableList.cs:166)
Opsive.UltimateInventorySystem.Editor.VisualElements.SearchableList`1[T].SearchAndSort (System.String searchString) (at Assets/Opsive/UltimateInventorySystem/Editor/VisualElements/SearchableList.cs:132)
Opsive.UltimateInventorySystem.Editor.VisualElements.SearchableList`1[T].Refresh () (at Assets/Opsive/UltimateInventorySystem/Editor/VisualElements/SearchableList.cs:207)
Opsive.UltimateInventorySystem.Editor.VisualElements.SearchableList`1[T].Refresh (System.Collections.Generic.IList`1[T] itemSource) (at Assets/Opsive/UltimateInventorySystem/Editor/VisualElements/SearchableList.cs:198)
Opsive.UltimateInventorySystem.Editor.Managers.ListPanel`1[T].<.ctor>b__7_5 (System.Int32 index) (at Assets/Opsive/UltimateInventorySystem/Editor/Managers/ListPanel.cs:80)
Opsive.Shared.Editor.UIElements.ReorderableList.<ReorderableList>m__2 () (at <d0cea14bd50a4c1eb6ce133a0ead3fa0>:0)
UnityEngine.UIElements.Clickable.Invoke (UnityEngine.UIElements.EventBase evt) (at <7a3a4a9a2ef3474eb251c9a5e8d0e96e>:0)
UnityEngine.UIElements.Clickable.ProcessUpEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.Vector2 localPosition, System.Int32 pointerId) (at <7a3a4a9a2ef3474eb251c9a5e8d0e96e>:0)
UnityEngine.UIElements.Clickable.OnMouseUp (UnityEngine.UIElements.MouseUpEvent evt) (at <7a3a4a9a2ef3474eb251c9a5e8d0e96e>:0)
UnityEngine.UIElements.EventCallbackFunctor`1[TEventType].Invoke (UnityEngine.UIElements.EventBase evt) (at <7a3a4a9a2ef3474eb251c9a5e8d0e96e>:0)
UnityEngine.UIElements.EventCallbackRegistry.InvokeCallbacks (UnityEngine.UIElements.EventBase evt) (at <7a3a4a9a2ef3474eb251c9a5e8d0e96e>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <7a3a4a9a2ef3474eb251c9a5e8d0e96e>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <7a3a4a9a2ef3474eb251c9a5e8d0e96e>:0)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <7a3a4a9a2ef3474eb251c9a5e8d0e96e>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <7a3a4a9a2ef3474eb251c9a5e8d0e96e>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <7a3a4a9a2ef3474eb251c9a5e8d0e96e>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <7a3a4a9a2ef3474eb251c9a5e8d0e96e>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <7a3a4a9a2ef3474eb251c9a5e8d0e96e>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <7a3a4a9a2ef3474eb251c9a5e8d0e96e>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <7a3a4a9a2ef3474eb251c9a5e8d0e96e>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <7a3a4a9a2ef3474eb251c9a5e8d0e96e>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <7a3a4a9a2ef3474eb251c9a5e8d0e96e>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <7a3a4a9a2ef3474eb251c9a5e8d0e96e>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <7a3a4a9a2ef3474eb251c9a5e8d0e96e>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <7a3a4a9a2ef3474eb251c9a5e8d0e96e>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <7a3a4a9a2ef3474eb251c9a5e8d0e96e>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <2500dd078a544a69b6c923861af6cd15>:0)
 
Some bugs with the setup window after clearing out currency as well .\

Is this system only designed for 3 currencies? I am unable to get exchange rates setup properly for more than 3 currency types.

I would take a close look at this and try doing some random things to the currency setup. For instance, if you decide to remove one currency and make a new type. You are forced to delete everything in order to stop the errors.

For instance, if i wanted to keep only two currency types and i delete GOLD. It will still be setup as an exchange for silver and throw errors without allowing me to remove gold from the exchange rate on silver.

In this snippet you can see what is left after clearing out all currency types.
 

Attachments

  • Currency Setup Bug.JPG
    Currency Setup Bug.JPG
    43.7 KB · Views: 5
Last edited:
It is expected to see error in exchange rates for currency that was removed. What is not expected is that we cannot fix it without deleting everything, since it will not allow you to press the exchange button to select a new one.
 
Thank you for bringing this to my attention, I'm sorry for the inconvenience caused by that bug. I'll fix all these issues for the next update.

The system is designed to have as many currencies as you wish, I'm assuming the errors you had messed something up and prevent you from setting up more than three currencies.

For a work around I would assume that if you deleted all the currencies and set them up from scratch it should work. If not please do let me know
 
Thanks for looking into it. Starting fresh, after deleting everything worked. Replacing a currency, while leaving behind any of the demo currency, caused the editor to throw errors.
 
Top