Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Warning about multiple Array Pools Settings
#1
I was getting this warning "[Curvy] More than one instance of 'Array Pools Settings' detected. You should keep only one instance of this script." any time I switched scenes from one scene that used Curvy to another that used Curvy.

It seems like the issue is due to the way DTSingleton checks for and removes duplicates. Any time you add Curvy components to a scene it generates a CurvyGlobalManager in that scene with its own ArrayPoolsSettings. If the singleton detects that it is a duplicate it will call "this.Invoke(DestroySelf, 0)" to remove itself, however due to the way the Invoke works it won't be removed until the next tick. That means that the duplicate ArrayPoolsSettings that is attached to the CurvyGlobalManager has a chance to run its OnEnable before being destroyed which throws the warning because for that single tick it detects multiples of itself.

I was able to fix the warning by changing the "this.Invoke(DestroySelf, 0)" to just DestroySelf() and everything seems to work fine. Was there a specific reason that the Invoke was used instead of an immediate call?
Reply


Messages In This Thread
Warning about multiple Array Pools Settings - by nkornek - 02-22-2023, 08:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Distance travelled across multiple splines jh092 1 7 02-23-2024, 09:44 AM
Last Post: _Aka_
  Multiple Splines and Generators Performantly for Road System drock 1 6 07-17-2023, 10:31 AM
Last Post: _Aka_
  Multiple ArrayPoolsSettings tairoark 6 11 11-15-2022, 11:34 AM
Last Post: tairoark
  Multiple Mesh Extrude Generator bakin 1 10 09-17-2022, 12:40 PM
Last Post: _Aka_

Forum Jump: