Home Game Development Is it attainable to mark a Unity prefab variant as deprecated?

Is it attainable to mark a Unity prefab variant as deprecated?

0
Is it attainable to mark a Unity prefab variant as deprecated?

[ad_1]

Personally I might not advocate leaving deprecated prefabs in your undertaking. If you are not cautious, these deprecated recordsdata are extraordinarily complicated for brand new staff members, or when doing upkeep years down the highway whenever you now not keep in mind each little element. It additionally makes looking your undertaking extra tedious since your search outcomes will embody deprecated recordsdata.

I’d counsel both deleting the unhealthy prefab, or simply modifying to repair it reasonably than making a brand new model. If you ever want the previous model once more (why would you?) – that is what model management is for.

If you completely should maintain the previous prefab for some actually reputable cause and never out of a worry of ever deleting something, you must rename it and embody the phrase “Deprecated” within the new title.

Rationale

Deprecation is generally used within the context of public APIs/packages, the place your staff is creating code or different property that shall be utilized by different groups. You mark an API or different asset as deprecated when it is now not supported and shall be eliminated in a future model; the one cause you are protecting it round is for backwards compatibility, so builders that use your API/bundle do not have to right away replace their code to maintain their undertaking working.

When you’re engaged on an inner undertaking solo or with a small staff, there’s not a whole lot of cause to maintain round deprecated recordsdata. You do not have to fret about breaking another person’s undertaking whenever you take away an previous model of a file (until you are engaged on a shared library that’s utilized by a number of inner tasks). The largest concern is if you’re engaged on a big staff the place a number of builders is likely to be at the moment working with the asset that you just wish to eliminate; then you could must coordinate with them to ensure you do not do one thing that causes merge conflicts.

If you wish to change a damaged prefab as a result of it isn’t attainable to repair the prefab, there is a technique to change the prefab, (normally) with out breaking present references to that prefab:

  1. Create the brand new prefab that works accurately.
  2. Minimize Unity and don’t open it once more till you attain step 5.
  3. In your working system’s file browser (e.g. Explorer, Finder), discover and delete the prefab file, however not the corresponding .meta file.
  4. Delete the .meta file for the brand new prefab. Rename the brand new prefab with the identical title because the previous prefab.
  5. Open Unity once more.

What we have completed right here is change the previous prefab with a brand new prefab with the identical GUID (that is outlined within the .meta file). Any elements that referenced the previous prefab by GUID will typically nonetheless have their references to the brand new prefab. However, references to a particular script on the prefab will now not be legitimate if the brand new prefab does not have the identical script.

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here