private void WriteToInfo()
        {
            var list = m_Assets;
            int max  = list.Count;

            for (int i = 0; i < max; i++)
            {
                var comp = m_Assets[i];
                CustomAssetComponentInfo compInfo;
                if (i < m_Info.assets.Count)
                {
                    compInfo = m_Info.assets[i];
                }
                else
                {
                    compInfo = new CustomAssetComponentInfo();
                    m_Info.assets.Add(compInfo);
                }
                comp.WriteToInfo(ref compInfo, out var customAssets);

                compInfo.assetItems?.Clear();
                compInfo.assetItems = new List <CustomAssetInfo>();

                int m = customAssets.Count;
                for (int j = 0; j < m; j++)
                {
                    var asset = customAssets[j];
                    var info  = new CustomAssetInfo();
                    asset.WriteToInfo(ref info);
                    compInfo.assetItems.Add(info);
                }
            }
        }
Exemple #2
0
 public void WriteToInfo(ref CustomAssetInfo assetInfo)
 {
     assetInfo.assetName   = assetName;
     assetInfo.asset       = asset;
     assetInfo.tex2D       = tex2D;
     assetInfo.audioClip   = audioClip;
     assetInfo.sprite      = sprite;
     assetInfo.textData    = textData;
     assetInfo.assetBundle = assetBundle;
 }
Exemple #3
0
        public void SyncFromInfo(ref CustomAssetInfo assetInfo)
        {
            asset       = assetInfo.asset;
            tex2D       = assetInfo.tex2D;
            audioClip   = assetInfo.audioClip;
            sprite      = assetInfo.sprite;
            textData    = assetInfo.textData;
            assetBundle = assetInfo.assetBundle;
            assetName   = assetInfo.assetName;

            UpdateCustomAssetName();
        }