Project

General

Profile

Bug #5361

Newly spawned parts in editor have prefab pointing to themselves rather than real part prefab

Added by blowfish over 8 years ago. Updated almost 8 years ago.

Status:
Closed
Severity:
Low
Assignee:
-
Category:
Plugins/Add-Ons
Target version:
-
Start date:
09/02/2015
% Done:

100%

Version:
Platform:
Any
Expansion:
Language:
English (US)
Mod Related:
No
Votes:
Arrow u r green
Arrow d r red

Description

When a part is created in the editor, part.partInfo.partPrefab points to part rather than the real prefab. This is probably an artifact of the way Unity instantiates prefabs - any references to a component in the serialization tree will point to the newly instantiated component rather than the original prefab. This probably also means that part.partInfo points to a copy of the AvailablePart rather than the global instance that PartLoader keeps track of.

This should be a one line fix - after the part is instantiated, either set part.partInfo to the global AvailablePart instance, or set part.partInfo.partPrefab to the global prefab instance - I don't know if it's critical to keep part.partInfo as the global instance or if a copy of that will suffice.

History

#2 Updated by blowfish about 8 years ago

I believe NathanKell fixed this, so it can be closed.

#3 Updated by NathanKell almost 8 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Fixed in 1.0.5.

Also available in: Atom PDF