Search Unity

SerializedProperty and restoring reference after change

Discussion in 'Scripting' started by llavigne, Apr 5, 2010.

  1. llavigne

    llavigne

    Joined:
    Dec 27, 2007
    Posts:
    977
    How do I restore reference when creating and changing prefabs:

    asset: asset-(geo1,geo2)
    where (geo1, geo2) represent two meshes parented to asset and asset the root node of this asset (a maya file)
    prefab : root-GEO-asset-(geo1,geo2)
    root is the top node, GEO is parented to it and asset-... parented to GEO
    Script is connected to root and contains a variable called target
    target is referencing geo1

    when I replace asset under GEO the reference of target to geo1 is broken

    how do I keep track of this connection and how do I restore it ?