Search Unity

Persistent Unique Prefab Identifier

Discussion in 'Editor & General Support' started by Kristian, Jul 24, 2013.

  1. Kristian

    Kristian

    Joined:
    Sep 2, 2011
    Posts:
    29
    I'm hoping that I've overlooked some value here, because I cannot find a publically available identifier for a prefab that is consistent across editors running the same game. I've tried checking out Object.GetInstanceID and Object.GetHashCode, but along with being identical, they vary from editor to editor.


    The reason why I think/know that such a value is available, is due to Network.Instantiate stating that it is using such a thing "... Network Instantiate is simply a convenience function built around RPC calls. It serializes an identifier of the prefab that is to be instantiated ..." Which results in the correct prefab being instantiated on both machines, without refering to it by name and placing it in the Resource folder, which seems my only option.


    I can understand if the value is private and simply not available to users; probably for some security reason or such. But I would just like to know, so I can stop pursuing the dream.

    I hope one of you can help, it would really simplify what I need to do.
    Thanks in advance!
    Kristian Klie - BetaDwarf
     
  2. NTDC-DEV

    NTDC-DEV

    Joined:
    Jul 22, 2010
    Posts:
    593
    There are no exposed persistent GUID for objects in Unity. I had to setup my own system.
     
  3. Kristian

    Kristian

    Joined:
    Sep 2, 2011
    Posts:
    29
    Thanks for the reply. I figured so much, but I just wanted to make sure.