예제 #1
0
        public void AddOrUpdate(string wwisePlatform, string language, AssetReferenceWwiseBankData bankRef)
        {
            if (m_dataPerPlatformList == null)
            {
                m_dataPerPlatformList = Array.Empty <WwiseBankPerPlatformEntry>();
            }

            WwiseBankPerPlatformEntry foundEntry = null;

            foreach (var entry in m_dataPerPlatformList)
            {
                if (entry.WwisePlatform == wwisePlatform)
                {
                    if (entry.WwisePlatform == wwisePlatform)
                    {
                        foundEntry = entry;
                        break;
                    }
                }
            }

            if (foundEntry != null)
            {
                foundEntry.LocalizedBanks[language] = bankRef;
            }
            else
            {
                foundEntry = new WwiseBankPerPlatformEntry {
                    WwisePlatform = wwisePlatform
                };
                foundEntry.LocalizedBanks[language] = bankRef;
                ArrayUtility.Add(ref m_dataPerPlatformList, foundEntry);
            }
        }
예제 #2
0
        public void OnBeforeSerialize()
        {
#if UNITY_EDITOR
            string wwisePlatform = GetWwisePlatformNameFromBuildTarget(EditorUserBuildSettings.activeBuildTarget);
            if (m_dataPerPlatformList != null)
            {
                foreach (var entry in m_dataPerPlatformList)
                {
                    entry.LocalizedBankKeys             = entry.LocalizedBanks.Keys.ToArray();
                    entry.LocalizedBanksValues          = entry.LocalizedBanks.Values.ToArray();
                    entry.LocalizedStreamingMediaKeys   = entry.LocalizedStreamingMedia.Keys.ToArray();
                    entry.LocalizedStreamingMediaValues = new LocalizedStreamingMediaList();
                    entry.LocalizedStreamingMediaValues.Add(entry.LocalizedStreamingMedia.Values.ToList());

                    if (entry.WwisePlatform == wwisePlatform)
                    {
                        CurrentPlatformAssets = entry;
                    }
                }
            }
#endif
            loadState = BankLoadState.Unloaded;
        }
        public void OnBeforeSerialize()
        {
#if UNITY_EDITOR
            string wwisePlatform = AkBasePathGetter.GetPlatformName();
            if (m_dataPerPlatformList != null)
            {
                foreach (var entry in m_dataPerPlatformList)
                {
                    entry.LocalizedBankKeys             = entry.LocalizedBanks.Keys.ToArray();
                    entry.LocalizedBanksValues          = entry.LocalizedBanks.Values.ToArray();
                    entry.LocalizedStreamingMediaKeys   = entry.LocalizedStreamingMedia.Keys.ToArray();
                    entry.LocalizedStreamingMediaValues = new LocalizedStreamingMediaList();
                    entry.LocalizedStreamingMediaValues.Add(entry.LocalizedStreamingMedia.Values.ToList());

                    if (entry.WwisePlatform == wwisePlatform)
                    {
                        CurrentPlatformAssets = entry;
                    }
                }
            }
#endif
            loadState = BankLoadState.Unloaded;
        }