Error connected with RequireComponent attribute.

Issue #41 resolved
Krzysztof Kansy created an issue

There is an error when reverting prefab which had a component required by other (let's call it RequiredComponent) and a component that requires RequiredComponent (let's call it DependentComponent). Error shows up when we are reverting this prefab after removing both of the components. It seems to be caused by the system first trying to DestroyImmediate the RequiredComponent which is obviously impossible before DependentComponent is destroyed. So the reverting has to be done twice for both of the components are destroyed.

Steps to reproduce:

  1. Create Child object and Parent object, make them prefabs.
  2. Make Child prefab a child of Parent prefab.
  3. Create RequiredComponent and DependentComponent, make Dependent require RequiredComponent and attach both to Child prefab. Revert so the instance under Parent prefab is updated.
  4. Remove DependentComponent and RequiredComponent from Child and Revert - here is the error, Child under Parent have only DependentComponent removed.
  5. Revert Child again - Child under Parent have now both components removed as it should.

Comments (2)

  1. Devon Klompmaker
    • changed status to open

    Good find. I will take a look into this, and submit a fix to the asset store!

    Thanks again,

  2. Log in to comment