phantomfox

Hi,
when i try to compare skeletonDataAssets (one on a SkeletonAnimation, the others as references in class), some unexpected behaviour happens.
i also tried to compare the names which each other, which also led to some unexpected behaviour.
can someone tell my what i am doing wrong here, or how this should be done instead.
I attached my codefile. the function in question is the switchSalsaComponent at the bottom, but i also do the comparision at setMouthSkin, where it seems to work fine. (i checked the references multiple times, they are set correctly in the inspector)
(atm i compare the names of the object, before that, i tried comparing them by itself)

Sincerely,
Max

---

ok found my mistake, with the strings, sry for that, the problem with the object comparison still remains.
You do not have the required permissions to view the files attached to this post.
phantomfox
  • Posts: 12

Harald

Direct comparison of Unity Asset references might lead to problems as I remember a case where Unity might reload an asset and then provide you with a different reference value. Comparing names or any other unique property should be more reliable.
User avatar
Harald

Harri
  • Posts: 2091


Return to Unity