mattrdowney / planetaria

A Unity framework for Euclidean 2-sphere games (e.g. 2D virtual reality games) [quasi-MIT license]
Other
10 stars 2 forks source link

Previous GameObject reference improperly held when switching Component from GameObject1 to GameObject2 in the Editor/Inspector #106

Open mattrdowney opened 6 years ago

mattrdowney commented 6 years ago

This is extremely confusing, and definitely would lead to a lot of user frustration. I only figured it out after about 30 minutes (knowing the code full-well) and only when I was about to restart Unity.

mattrdowney commented 6 years ago

Notably, Reset() did not work (because Reset() has an if condition). I am almost positive I tried Reset() before trying to close/restart.

mattrdowney commented 6 years ago

The fix: any instance of Reset() should not be conditional. Perhaps instantiate can be passed a reset flag the overrides if conditions.

mattrdowney commented 6 years ago

This was (partially!) fixed as of 70b8baf86255bd19064590445eb84b9fad8554e1

This has to be solved for all Reset methods (added to OnValidate()?)