GithubHelp home page GithubHelp logo

Comments (5)

favoyang avatar favoyang commented on July 18, 2024

Hi @ambr-kobayashi,

Thanks for reporting the issue. However, I can not reproduce it with 1.8.3. The importer creates AddressableAssetEntry using AddressableAssetSettings.CreateOrMoveEntry, which is the same as the Addressable GUI does. For m_MainAsset and m_TargetAsset, both are just cached properties and can be re-acquired from runtime.

E.g. the only place that references m_MainAsset is via MainAsset:

        [SerializeField]
        private UnityEngine.Object m_MainAsset;
        /// <summary>
        /// The main asset object for this entry.
        /// </summary>
        public UnityEngine.Object MainAsset
        {
            get
            {
                if (m_MainAsset == null)
                {
                    AddressableAssetEntry e = this;
                    while (string.IsNullOrEmpty(e.AssetPath))
                    {
                        if (e.ParentEntry == null)
                            return null;
                        e = e.ParentEntry;
                    }

                    m_MainAsset = AssetDatabase.LoadMainAssetAtPath(AssetPath);
                }

                return m_MainAsset;
            }
        }

from unity-addressable-importer.

ambr-kobayashi avatar ambr-kobayashi commented on July 18, 2024

@favoyang
Thanks for replying quickly!!
I'll organize how to represent this situation.

from unity-addressable-importer.

favoyang avatar favoyang commented on July 18, 2024

@ambr-kobayashi,

Could you reproduce the issue? If not I'm going to close this issue, because the title is a bit misleading.

from unity-addressable-importer.

ambr-kobayashi avatar ambr-kobayashi commented on July 18, 2024

@favoyang
sorry for re-investigating about this issue.
From the conclusion, your plugin works fine, so this issue should be closed.

Though there are difference of AddressableAssetGroup between adding manually and using this plugin in yaml file.

yaml file becomes like this with manually add addressables to asset groups( using GUI ).

m_SerializeEntries:
  - m_GUID: 1960c6e5989d942febb46da7fd71cdc1
    m_Address: asset_001
    m_ReadOnly: 0
    m_SerializedLabels: []
    m_MainAsset: {fileID: 8300000, guid: 1960c6e5989d942febb46da7fd71cdc1, type: 3}
    m_TargetAsset: {fileID: 8300000, guid: 1960c6e5989d942febb46da7fd71cdc1, type: 3}
  - m_GUID: 36e7e2406deee4ebe86c1f635eb36a5f
    m_Address: asset_002
    m_ReadOnly: 0
    m_SerializedLabels: []
    m_MainAsset: {fileID: 8300000, guid: 36e7e2406deee4ebe86c1f635eb36a5f, type: 3}
    m_TargetAsset: {fileID: 8300000, guid: 36e7e2406deee4ebe86c1f635eb36a5f, type: 3}

with using this plugin, yaml file becomes like this.

  m_SerializeEntries:
  - m_GUID: d5a0e7311d56e46a194fd2ae8de6d3ef
    m_Address: asset_003
    m_ReadOnly: 0
    m_SerializedLabels:
    - LabelTest
    m_MainAsset: {fileID: 0}
    m_TargetAsset: {fileID: 0}
  - m_GUID: f1feb72c825d44c89a1614f8b4f70c1a
    m_Address: asset_004
    m_ReadOnly: 0
    m_SerializedLabels:
    - LabelTest
    m_MainAsset: {fileID: 0}
    m_TargetAsset: {fileID: 0}

However, AddressableAssetEntry.TargetAsset and AddressableAssetEntry.MainAsset are used in ( refered by ) EditorScript only.
Therefore, there is no effect on runtime script.

I apologize about miss reporting and checking behaviour insufficiently.

from unity-addressable-importer.

favoyang avatar favoyang commented on July 18, 2024

Thanks for the detailed explanation. I guess when you using the GUI the m_MainAsset and m_TargetAsset are touched and serialized by Unity.

Issue closed.

from unity-addressable-importer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.