Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We are updating our Terms of Service for all Unity subscription plans, effective October 13, 2022, to create a more streamlined, user-friendly set of terms. Please review them here: unity.com/legal/terms-of-service.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Sub asset InstanceId will same relative to main asset's InstanceID?

Discussion in 'Editor & General Support' started by tinyant, Oct 18, 2018.

  1. tinyant

    tinyant

    Joined:
    Aug 28, 2015
    Posts:
    117
    I want to use AssetDatabase.CopyAsset to copy my asset. I want to Identify it's sub asset when copy over.
    First time I use sub asset name to identify same sub asset in Main Asset.but when we have same sub asset name. I can't identify sub asset just use name.

    I wonder if the sub asset's relative instanceid is always same relative to Main Asset?

    MyAsset : 1000
    sub01: 1001
    sub02: 1002
    sub02: 1003

    Copy-MyAsset:2000
    sub01:2001
    sub02:2002
    sub02:2003

    If the sub asset instance id is same relative to main asset I can identify sub02(1003) in MyAsset and sub02(2003) will be the "same" sub asset when make a copy.

    thanks.
     
unityunity