#I am using IsValid isDone

1 messages · Page 1 of 1 (latest)

lethal bear
#

Yes, it is not valid if it is not loaded, so I guess you shouldn't use reverse statement for isDone at least

#

IsValid() && isDone

#

!IsValid() || !isDone

untold totem
#

IsValid() && !isDone is to check if it is currently being instanced

#

doesn't it work?

lethal bear
#

no, this statement will almost always be false

untold totem
#

!IsValid() || !isDone wouldn't this be either not started loading, or currently loading?

#

hmm

lethal bear
#

are you trying to start instancing process once and then multiple times get the result?

untold totem
#

when a handle ends loading, does it make it not valid?

#

It's just that I instance based on distance to an anchor, and it checks every 0.1s. If it tries to instance twice before it's done, then I get double instance.

#

I use InstantiateAsync

lethal bear
#

I may be wrong with instancing but I rely only on valid statement to load and unload scenes for example. So while my scene is loaded my reference will be valid

untold totem
#

hmm

untold totem
#

yes

#

I guess I can check if the asset is valid, since it's synchronously instanced once the asset is loaded (InstanceAsync does the LoadAssetAsync behind the scenes)

#

thanks for helping

lethal bear
#

We are loading the same sprite with the same reference from different places like this