Is there any reason to use a Serialzefield for the Unit?

About 3:30 into the video the Unit unit is made a serialized field in order to assign the parent unit object to it.
Why not simply use a GetComponentInParent<Unit>() for it?

It all happens within the Unit prefav anyway and we know the selection visual is a child object of it.

You can use `GetComponentInParent() if you wish. This was simply the way Hugo chose to set things up.

There are many paths to the same goal.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms